akhauriyash/Code-Regression huggingface dataset:
#include<algorithm>     //sort,二分探索,など
#include<bitset>        //固定長bit集合
#include<cmath>         //pow,logなど
#include<complex>       //複素数
#include<deque>         //両端アクセスのキュー
#include<fstream>       //ファイルストリーム（標準入力変更用）
#include<functional>    //sortのgreater
#include<iomanip>       //setprecision(浮動小数点の出力の誤差)
#include<iostream>      //入出力
#include<iterator>      //集合演算(積集合,和集合,差集合など)
#include<map>           //map(辞書)
#include<numeric>       //iota(整数列の生成),gcdとlcm(c++17)
#include<queue>         //キュー
#include<set>           //集合
#include<stack>         //スタック
#include<string>        //文字列
#include<unordered_map> //イテレータあるけど順序保持しないmap
#include<unordered_set> //イテレータあるけど順序保持しないset
#include<utility>       //pair
#include<vector>        //可変長配列

//名前
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef map<string, int> msi;
typedef map<string, ll> msll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pllll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<vector<int>> vvi;
typedef vector<vector<ll>> vvll;
typedef vector<vector<string>> vvs;
typedef vector<vector<bool>> vvb;

//定数
const ll MOD = 1000000007;
const ll INF = 1000000000000000000;

//マクロ
#define rep(i,n) for(int i=0;i<n;i++)
#define reps(i,s,e) for(int i=s;i<e;i++)
#define repse(i,s,e) for(int i=s;i<=e;i++)
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define in1(x1) cin >> x1
#define in2(x1, x2) cin >> x1 >> x2
#define in3(x1, x2, x3) cin >> x1 >> x2 >> x3
#define inN(x, N) rep(i, N) in1(x[i])
#define outl(x) cout << x << endl
#define out2l(x, y) cout << x << " " << y << endl 

//よく使う関数
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

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

    //標準入力をファイルに変更
    //std::ifstream in("input.txt");
    //std::cin.rdbuf(in.rdbuf());

    int A, B, C;
    in3(A, B, C);

    int ans = 0;
    chmax(ans, 10 * A + B + C);
    chmax(ans, 10 * A + C + B);
    chmax(ans, 10 * B + A + C);
    chmax(ans, 10 * B + C + A);
    chmax(ans, 10 * C + A + B);
    chmax(ans, 10 * C + B + A);

    outl(ans);

    return 0;
}


Measured memory_bytes: 3604
#include<bits/stdc++.h>
using namespace std;
map<int,vector<int> >m;
long long int cache[1000000];
long long int longest_path(long int i)
{
	if(cache[i]!=-1)
	return cache[i];
	long int x=m[i].size();
	if(x==0)
	return cache[i]=0;
	long int j;
	long long  int max=0;
	for(j=0;j<x;j++)
	{long int y=longest_path(m[i][j])+1;
	if(max<y)
	max=y;
	}
	return cache[i]=max;
	
}
int main()
{
	long int N,M;
	cin>>N>>M;
	memset(cache,-1,sizeof(cache));
	long int i;
	for(i=0;i<M;i++)
	{
		long int x,y;
		cin>>x>>y;
		m[x].push_back(y);
	}
	long long max=0;
	for(i=1;i<=N;i++)
	{long long int z=longest_path(i);
	if(z>max)
	max=z;
	}
	cout<<max;
}

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

using namespace std;


void solve() {
    int k, x;
    cin >> k >> x;
    for (int i = x-k+1; i < x+k; i++) {
        cout << i << ' ';
    }
}

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


Measured memory_bytes: 256
n = int(input())
sqrt_n = int(n ** 0.5)
ans = 10

for i in range(1, sqrt_n + 1):
    let = n // i
    if n % i == 0:
        if len(str(max(i, let))) < ans:
            ans = len(str(max(i, let)))
print(ans)

Measured memory_bytes: 3060
s = input()
x, y = list(map(int, input().split()))

s = s.split('T')
move_x = s[::2]
move_y = s[1::2]

x_cur = len(move_x[0])
for nx in sorted(move_x[1:], reverse = True):
    if x_cur <= x:
        x_cur += len(nx)
    else:
        x_cur -= len(nx)

y_cur = 0
for ny in sorted(move_y, reverse = True):
    if y_cur <= y:
        y_cur += len(ny)
    else:
        y_cur -= len(ny)

if x_cur == x and y_cur == y:
    print('Yes')
else:
    print('No')


Measured memory_bytes: 3188
using System;
using System.Text;

namespace _083_EraNameTransformation
{
	class Program
	{
		static void Main ( string[] args )
		{
			DateTime meiji = new DateTime (1868, 9, 8);
			DateTime taisho = new DateTime (1912, 7, 30);
			DateTime showa = new DateTime (1926, 12, 25);
			DateTime heisei = new DateTime (1989, 1, 8);

			string inputStr;
			StringBuilder output = new StringBuilder (15 * 50);

			while ((inputStr = Console.ReadLine ()) != null)
			{
				int[] tmp = Array.ConvertAll (inputStr.Split (' '), int.Parse);
				DateTime now = new DateTime (tmp[0], tmp[1], tmp[2]);

				// = pre-meiji
				if (now < meiji)
				{
					output.AppendLine ("pre-meiji");
				}
				// = meiji
				else if (now < taisho)
				{
					output.Append ("meiji ");
					output = AppendDate (output, now.Year - meiji.Year + 1, tmp[1], tmp[2]);
					output.AppendLine ();
				}
				// = taisyo
				else if (now < showa)
				{
					output.Append ("taisho ");
					output = AppendDate (output, now.Year - taisho.Year + 1, tmp[1], tmp[2]);
					output.AppendLine ();
				}
				// = showa
				else if (now < heisei)
				{
					output.Append ("showa ");
					output = AppendDate (output, now.Year - showa.Year + 1, tmp[1], tmp[2]);
					output.AppendLine ();
				}
				// = heisei
				else
				{
					output.Append ("heisei ");
					output = AppendDate (output, now.Year - heisei.Year + 1, tmp[1], tmp[2]);
					output.AppendLine ();
				}
			}

			Console.Write (output);
		}

		static StringBuilder AppendDate ( StringBuilder s, int year, int month, int day )
		{
			s.Append (year);
			s.Append (" ");
			s.Append (month);
			s.Append (" ");
			s.Append (day);

			return s;
		}
	}
}

Measured memory_bytes: 9156
#pragma region
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <vector>
#include <map>
#include <queue> 
#include <stack>
#include <set>
#include <list>

using namespace std;
typedef long long ll;
//#define rep(i, s, e) for (int(i) = (s); (i) < (e); ++(i))
#define rep(i, e) for (int(i) = 0; (i) < (e); ++(i))
#define all(x) x.begin(),x.end()
#pragma endregion


int main()
{
	int n; cin >> n;
	vector<ll> s(n + 1);
	s[0] = 0;
	rep(i, n)
	{
		ll a; cin >> a;
		s[i + 1] = s[i] + a;
	}
	ll can1 = 0;
	ll now = 0;
	bool plus = true;
	for (int i = 1; i <= n; ++i)
	{
		if (plus && s[i] + now <= 0)
		{
			can1 += 1 - (s[i] + now);
			now += 1 - (s[i] + now);
		}
		else if (!plus && 0 <= s[i] + now)
		{
			can1 += s[i] + now + 1;
			now -= s[i] + now + 1;
		}
		plus ^= 1;
	}
	ll can2 = 0;
	now = 0;
	plus = false;
	for (int i = 1; i <= n; ++i)
	{
		if (plus && s[i] + now <= 0)
		{
			can2 += 1 - (s[i] + now);
			now += 1 - (s[i] + now);
		}
		else if (!plus && 0 <= s[i] + now)
		{
			can2 += s[i] + now + 1;
			now -= s[i] + now + 1;
		}
		plus ^= 1;
	}
	cout << min(can1, can2) << endl;
}

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

int main(void){
    // Your code here!
    int n;
    int a[100];
    int m = 0;
    
    std::cin >> n;
    
    for(int i = 0; i < n; i++){
        std::cin >> a[i];
    }
    
    for(int i = 0; i < n; i++){
        for(int j = 0; j < n; j++){
            if(i != j && abs(a[i] - a[j]) > m) m = a[i] - a[j];
        }
    }
    
    std::cout << m << std::endl;
    
    return 0;
}


Measured memory_bytes: 256
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from heapq import heapify, heappop, heappush

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
 
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()

def no_agc(last4):
    for i in range(4):
        cp_last4 = list(last4)
        if i >= 1:
            cp_last4[i-1], cp_last4[i] = \
            cp_last4[i], cp_last4[i-1]
        cp_last_sent = "".join(cp_last4)
        if cp_last_sent.count("AGC") >= 1:
            return False
    return True

# q = deque([(0, "TTT")])
ans = 0
memo = [{} for i in range(N+1)]
def dfs(idx, last3):
    # idx, last3 = q.popleft()
    if last3 in memo[idx]:
        return memo[idx][last3]

    if idx == N:
        return 1
    ret = 0
    for c in "AGCT":
        if no_agc(last3 + c):
            last3_new = (last3 + c)[1:]
            idx_new = idx + 1
            ret = (ret + dfs(idx_new, last3_new)) % mod
    memo[idx][last3] = ret

    return ret
print(dfs(0, "TTT"))


    



Measured memory_bytes: 4604
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <vector>
#include <queue>
#include <set>
#include <map>

using namespace std;
typedef long long ll;

typedef pair<ll, int> P;

P p[100000];
ll sum[100000];
ll X[100000];
int A[100000], B[100000];

struct UnionFind {
  vector<int> data;
  UnionFind(int size) : data(size, -1) { }
  bool unionSet(int x, int y) {
    x = root(x); y = root(y);
    if (x != y) {
      if (data[y] < data[x]) swap(x, y);
      data[x] += data[y]; data[y] = x;
      ll tmp = sum[x];
      sum[x] += sum[y];
      sum[y] += tmp;
    }
    return x != y;
  }
  bool findSet(int x, int y) {
    return root(x) == root(y);
  }
  int root(int x) {
    return data[x] < 0 ? x : data[x] = root(data[x]);
  }
  int size(int x) {
    return -data[root(x)];
  }
};

struct edge{
    int to;
    ll cost;
};

int cnt;
vector<edge> G[100000];
bool used[100000];
bool use[100000];

void dfs(int v, ll w){
    used[v] = true;
    //cout << v << endl;
    for(int i = 0; i < G[v].size(); i++){
        if(G[v][i].cost <= w) {
            cnt++;
            //if(v < G[v][i].to) cout << v << ' ' << G[v][i].to << endl;
            if(!used[G[v][i].to]) dfs(G[v][i].to, w);
        }
    }
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << setprecision(10) << fixed;
    int N, M;
    cin >> N >> M;
    for(int i = 0; i < N; i++){
        cin >> X[i];
        sum[i] += X[i];
    }
    for(int i = 0; i < M; i++){
        ll Y;
        cin >> A[i] >> B[i] >> Y;
        A[i]--; B[i]--;
        p[i] = P(Y, i);
        G[A[i]].push_back((edge){B[i], Y});
        G[B[i]].push_back((edge){A[i], Y});
    }
    sort(p, p+M);
    UnionFind uf(N);
    for(int i = 0; i < M; i++){
        int idx = p[i].second;
        ll w = p[i].first;
        uf.unionSet(A[idx], B[idx]);
        if(sum[uf.root(A[idx])] >= w){
            use[idx] = true;
        }
    }
    for(int i = M-1; i >= 0; i--){
        int idx = p[i].second;
        ll w = p[i].first;
        if(use[idx] && !used[A[idx]]) dfs(A[idx], w);
        if(use[idx] && !used[B[idx]]) dfs(B[idx], w);
    }
    //cout << cnt << endl;
    cout << M-cnt/2 << endl;
}

Measured memory_bytes: 17024
#include <iostream>
using namespace std;
#include <algorithm>
int main() {
	// your code goes here
	int n,k;
	cin>>n>>k;
	int arr[n];
	
	for(int i=0;i<n;i++)
	{
	    cin>>arr[i];
	}
	sort(arr,arr+n);
	long long sum=0;
	for (int i=0;i<n-k;i++)
	{
	    sum=sum+arr[i];
	}
	cout<<sum;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
#include <ext/hash_map>
#include <ext/numeric>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>

using namespace std;
using namespace __gnu_pbds;
using namespace __gnu_cxx;

#define REP(i,n) for( (i)=0 ; (i)<(n) ; (i)++ )
#define rep(i,x,n) for( (i)=(x) ; (i)<(n) ; (i)++ )
#define REV(i,n) for( (i)=(n) ; (i)>=0 ; (i)-- )
#define FORIT(it,x) for( (it)=(x).begin() ; (it)!=(x).end() ; (it)++ )
#define foreach(it,c) for(__typeof((c).begin()) it=(c).begin();it!=(c).end();++it)
#define rforeach(it,c) for(__typeof((c).rbegin()) it=(c).rbegin();it!=(c).rend();++it)
#define foreach2d(i, j, v) foreach(i,v) foreach(j,*i)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define SZ(x) ((int)(x).size())
#define MMS(x,n) memset(x,n,sizeof(x))
#define mms(x,n,s) memset(x,n,sizeof(x)*s)
#define pb push_back
#define mp make_pair
#define NX next_permutation
#define UN(x) sort(all(x)),x.erase(unique(all(x)),x.end())
#define CV(x,n) count(all(x),(n))
#define FIND(x,n) find(all(x),(n))-(x).begin()
#define ACC(x) accumulate(all(x),0)
#define PPC(x) __builtin_popcountll(x)
#define LZ(x) __builtin_clz(x)
#define TZ(x) __builtin_ctz(x)
#define mxe(x) *max_element(all(x))
#define mne(x) *min_element(all(x))
#define low(x,i) lower_bound(all(x),i)
#define upp(x,i) upper_bound(all(x),i)
#define NXPOW2(x) (1ll << ((int)log2(x)+1))
#define PR(x) cout << #x << " = " << (x) << endl ;

typedef unsigned long long ull;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vector<int> > vvi;
typedef pair<int, int> pii;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

const int OO = (int) 2e9;
const double eps = 1e-9;

const int N = 2e5 + 5;

int main() {
	std::ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
#ifndef ONLINE_JUDGE
//	freopen("in.txt", "rt", stdin);
//	freopen("out.txt", "wt", stdout);
#endif
	int a;
	cin >> a;
	cout << a + a * a + a * a * a << endl;
	return 0;
}


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

int H, W;
int c[10][10];
int ans = 0;

signed main(){
  cin >> H >> W;
  rep(i,10)rep(j,10)cin >> c[i][j];
  rep(k,10)rep(i,10)rep(j,10)c[i][j] = min(c[i][j],c[i][k] + c[k][j]);
  rep(i,H)rep(j,W){int a;cin >> a;if(a==-1)continue;ans+=c[a][1];}
  cout << ans;
}


Measured memory_bytes: 256
#include <iostream>
#include <cmath>
#include <complex>
#include <string>
#include <sstream>
#include <limits>
#include <numeric>
#include <algorithm>
#include <functional>

#include <vector>

using namespace std;

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

	int N, M;
	cin >> N >> M;

	vector<string> vA;
	for (int i = 0; i < N; i++)
	{
		string a;
		cin >> a;

		vA.push_back(a);
	}

	vector<string> vB;
	for (int i = 0; i < M; i++)
	{
		string b;
		cin >> b;

		vB.push_back(b);
	}

	for (int i = 0; i <= N - M; i++)
	{
		for (int j = 0; j <= N - M; j++)
		{
			bool check = true;
			for (int k = 0; k < M; k++)
			{
				for (int q = 0; q < M; q++)
				{
					if (vA[i + k][j + q] != vB[k][q])
					{
						check = false;
						break;
					}
				}

				if (!check) break;
			}

			if (check)
			{
				cout << "Yes";
				return 0;
			}
		}
	}

	cout << "No";

	return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
#include<cassert>
#define REP(i,s,n) for(int i=s;i<n;i++)
#define rep(i,n) REP(i,0,n)
#define MAX 2013
using namespace std;
short dp[MAX][MAX];
char path[MAX][MAX];

void lcs(string a,string b)
{
  int n = a.size();
  int m = b.size();
  
  REP(i,1,n+1)
    {
      REP(j,1,m+1)
	{
	  if(a[i-1] == b[j-1])
	    {
	      dp[i][j] = dp[i-1][j-1]+1;
	      path[i][j] = 'Z';
	    }
	  else if(dp[i][j-1] < dp[i-1][j])
	    {
	      dp[i][j] = dp[i-1][j];
	      path[i][j] = 'X';
	    }
	  else
	    {
	      dp[i][j] = dp[i][j-1];
	      path[i][j] = 'Y';
	    }
	}
    }

  // cout << dp[n][m] << endl;
  
  while(n > 0 && m > 0)
    {
      if(path[n][m] == 'Z')
	{
	  assert(a[n-1] == b[m-1]);	 
	  cout << a[n-1];
	  n--,m--;
	}
      else if(path[n][m] == 'X')n--;
      else                      m--;
    }
  cout << endl;
}

int main()
{
  string line;
  while(cin >> line)
    {
      rep(i,MAX)rep(j,MAX)dp[i][j] = 0;
      string rline(line.rbegin(),line.rend());
      lcs(line,rline);


    }
  return 0;
}

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

#define NIL 0

struct Node{
    int d=0, f=0, ch=0;
    int child[100]={0};
};

Node nodes[101];

int search(int num, int time){
    if(nodes[num].d!=NIL){
        return time;
    }
    nodes[num].d = time;
    ++time;
    for(int i=0;i<nodes[num].ch;++i){
        time = search(nodes[num].child[i], time);
    }
    nodes[num].f = time;
    ++time;
    return time;
}

int main(){
    
    int n, num=0, time = 1;
    cin >> n;
    for(int i=1;i<=n;++i){
        cin>>num;
        cin >> nodes[num].ch;
        for(int j=0;j<nodes[num].ch;++j){
            cin >> nodes[num].child[j];
        }
    }
    
    
    for(int i=1;i<=n;++i){
        if(nodes[i].d==NIL){
            time = search(i, time);
        }
    }
    
    
    for(int i=1;i<=n;i++){
        cout << i << " " << nodes[i].d << " " <<nodes[i].f << endl;
        
    }
    
    
    
    return 0;
}




Measured memory_bytes: 3140
H,W = map(int,input().split())
a = [list(map(int,input().split())) for i in range(H)]

ans = []
flag = False
before = []
for i in range(H):
    if i%2==0:
        for j in range(W):
            if (not flag) and a[i][j]%2==1:
                flag = True
                before = [i,j]
            elif flag and a[i][j]%2==1:
                flag = False
                ans.append([before[0]+1,before[1]+1,i+1,j+1])
            elif (not flag) and a[i][j]%2==0:
                pass
            else:
                ans.append([before[0]+1,before[1]+1,i+1,j+1])
                before = [i,j]
    else:
        for j in reversed(range(W)):
            if (not flag) and a[i][j]%2==1:
                flag = True
                before = [i,j]
            elif flag and a[i][j]%2==1:
                flag = False
                ans.append([before[0]+1,before[1]+1,i+1,j+1])
            elif (not flag) and a[i][j]%2==0:
                pass
            else:
                ans.append([before[0]+1,before[1]+1,i+1,j+1])
                before = [i,j]
N = len(ans)
print(N)
for i in range(N):
    print(*ans[i])

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

int main(){
  int N; cin >> N; cin.ignore();
  int A;
  vector<vector<int>> colors;
  cin >> A; cin.ignore();
  colors.push_back( vector<int>(1,A) );
  for(int i=1;i<N;i++){
    cin >> A; cin.ignore();
    int minIndex=-1;
    for(int j=colors.size()-1;j>=0;j--){
      if(A <= colors[j].back()) break;
      else{
        minIndex = j;
      }
    }
    if( minIndex == -1 ) colors.push_back( vector<int>(1,A) );
    else colors[minIndex].push_back( A );
  }
  cout << colors.size() << endl;
}

Measured memory_bytes: 6836
///AJoy Sarker ,CSE JAHANGIRNAGAR UNIVERSITY 48 Batch
#include<bits/stdc++.h>
using namespace std;
#define SORT(c) sort((c).begin(),(c).end());
#define pb push_back
#define MP make_pair
#define pii pair<int,int>
#define pcc pair<char,char>
#define pic pair<int,char>
#define pci pair<char,int>
#define VS vector<string>
#define VI vector<int>
#define pi 3.141592653589793
#define ll long long
#define ull unsigned long long
#define w(x) int x;cin>>x;while(x--)
#define fast ios_base::sync_with_stdio(0)
#define sz size()
typedef unsigned long long UL;
template<typename T>inline T  S(T a)
{
    return a*a;
}
template<class T>inline string tostring(T a)
{
    ostringstream os("");
    os << a;
    return os.str();
}
template<typename T>inline ll tolong(T a)
{
    ll res;
    istringstream os(a);
    os>>res;
    return res;
}
template<typename T>inline T gcd(T a, T b)
{
    if (b == 0)return a;
    else return gcd(b, a % b);
}
template<typename T>inline T bigmod(T a, T b, T m)
{
    if (b == 0)return 1;
    else if (b % 2 == 0)return S(bigmod(a, b / 2, m)) % m;
    else return (a % m*bigmod(a, b - 1, m)) % m;
}
const int inf = (int)1e9 + 5;
const ll linf = (ll)1e16 + 5;
const ll modd = (ll)1e9 + 7;
const int mod = 10000007;
/*#define N 20000009
bool prime[N];
vector<ll> prm;
void seive ()
{

    memset(prime, true, sizeof(prime));

    for( ll i=2; i*i<=N; i++)
    {
        if (prime[i] == true)
        {
            prm.pb(i);
            for (ll j=i*i; j<=N; j += i)
                prime[j] = false;
        }
    }
}*/
void pr (int f)
{
    if(f==1)
        cout<<"Yes\n";
    else
        cout<<"No\n";
}
map<int,int>mp;
//set<int > s;
multiset<string> :: iterator it;

deque <char> q ;
int vis [551000];
int p( int a ,int b)
{
    int d=1;
    for(int i=1;i<=b;i++)
    {
        d*=10;
    }
    return d;
}
int main()
{
    fast;
   string s,ss;
   cin>>s>>ss;
   int f=1;
   for(int i=0;i<s.sz;i++)
   {
       if(s[i]!=ss[i])
       {
           f=0;
       }
   }
   pr(f);
}





Measured memory_bytes: 3652
N = int(input())
A = list(map(int, input().split()))
count = 0

for i in range(N):
    mini = i
    for j in range(i, N):
        if A[j] < A[mini]:
            mini = j
    if i != mini:
        A[i], A[mini] = A[mini], A[i]
        count += 1

print(*A)
print(count)

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

int main() {
  int N;
  cin >> N;
  vector<int> A(N);
  vector<int> B(N);
  vector<int> C(N - 1);
  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 - 1; i++){
    cin >> C[i];
  }
  int sum = B[A[0] - 1];
  for (int i = 1; i < N; i++){
    if (A[i] - A[i - 1] == 1){
      sum += B[A[i] - 1] + C[A[i] - 2];
    }
    else {
      sum += B[A[i] - 1];
    }
  }
  cout << sum << endl;
}


Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <utility>
#include <vector>

using namespace std;

int main()
{
    int N;
    cin >> N;
    vector<pair<pair<string, int>, int>> SP(N, pair<pair<string, int>, int>(pair<string, int>("", 0), 0));
    for (int i = 0; i < N; i++)
    {
        SP[i].second = i + 1;
        cin >> SP[i].first.first >> SP[i].first.second;
        SP[i].first.second *= -1;
    }
    stable_sort(SP.begin(), SP.end());

    for (int i = 0; i < N; i++)
    {
        cout << SP[i].second << endl;
    }
    return 0;
}

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

using namespace std;

typedef long long ll;

const ll LongINF=1e13+7;
const int INF=1e9+7;
const int dx[]={0,1,0,-1};
const int dy[]={1,0,-1,0};

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;}
template <class T, class Y>T GCD(T a, Y b){if(a<b){int c=a;a=b;b=c;}if (a % b == 0){return b;}return GCD(b, a % b);}
void clear(queue<pair<int, int>> &q){queue<pair<int, int>> empty;swap(q, empty);} //queueの中身の型は適時変更を忘れない

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

vector<ll> memo;

int fib(int i){
    if(i==1)return 1;
    else if(i==0)return 0;

    if(memo[i]!=-1)return memo[i];

    return memo[i]=fib(i-1)+fib(i-2);
}

int main(){
    int N;
    cin>>N;
    memo.assign(N+2,-1);
    cout<<fib(N+1)<<endl;
    return 0;
}

//a=97,z=122


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

int main(){
    int a,b,w;
    cin >> w >> a >> b;
    if(a>b){
        int tmp = a;
        a = b;
         b = tmp;
    }
    int diff = b-(a+w);
    if(diff<0){
        cout << "0" << endl;
    }
    else{
        cout << diff << endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;
 
#define fi first
#define se second
#define mp make_pair
#define pb push_back
 
typedef long long ll;
typedef pair<ll,ll> ii;
typedef vector<int> vi;
typedef unsigned long long ull;
typedef long double ld; 
typedef tree<ii, null_type, less<ii>, rb_tree_tag, tree_order_statistics_node_update> pbds;

int main()
{
	ios_base::sync_with_stdio(0); cin.tie(0);
	int n; cin>>n;
	vi vec;
	for(int i=0;i<n;i++)
	{
		int x; cin>>x; x--; vec.pb(x);
	}
	vi ans;
	for(int i=n-1;i>=0;i--)
	{
		vi nw; int pos=-1;
		for(int j=int(vec.size())-1;j>=0;j--)
		{
			if(vec[j]==j)
			{
				pos=j; break;
			}
		}
		if(pos==-1)
		{
			cout<<-1<<'\n'; return 0;
		}
		if(pos>i)
		{
			cout<<-1<<'\n'; return 0;
		}
		ans.pb(pos);
		for(int j=0;j<vec.size();j++)
		{
			if(j==pos) continue;
			nw.pb(vec[j]);
		}
		vec=nw;
	}
	reverse(ans.begin(),ans.end());
	for(int x:ans) cout<<x+1<<'\n';
}


Measured memory_bytes: 256
import java.util.*;

class Main{
	public static void main(String args[]) {
		Scanner sc=new Scanner(System.in);
		long n=sc.nextLong();
		int[] num=new int[10];
		Arrays.fill(num,  -1);
		long sum=0;
		int count=0;
		int i=0;
		num[i]=0;
		boolean b3=false,b5=false,b7=false;
		while (sum<=n) {
			sum=0;
			for(int j=0;j<10;++j) {
				if(num[j]==3) {num[j]=0; ++num[j+1];}
				
				
				if(num[j]==0)sum=sum+3*(long)Math.pow(10, j);
				else if(num[j]==1)sum=sum+5*(long)Math.pow(10, j);
				else if(num[j]==2)sum=sum+7*(long)Math.pow(10, j);
				
			}

			if(sum<=n) {
				for(int j=0;j<10;++j) {
					if(num[j]==0)b3=true;
					if(num[j]==1)b5=true;
					if(num[j]==2)b7=true;
				}
				if(b3==true&&b5==true&&b7==true)++count;
			}
			b3=false;b5=false;b7=false;
			++num[0];
		}
		System.out.println(count);
	}
}


Measured memory_bytes: 22100
N = int(input())
x = [0] * N
y = [0] * N
for i in range(N):
    x[i],y[i] = map(int,input().split())

m = 1
for i in range(1,N):
    m *= i

ans = 0

for i in range(N):
    for j in range(N):
        ans += ((x[i]-x[j])**2 + (y[i]-y[j])**2)**(1/2) / N

print(ans)

Measured memory_bytes: 3188
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <functional>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef pair<ll, ll> P;
typedef vector<vector<P>> vvP;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define exrep(i, a, b) for(ll i = a; i <= b; i++)
#define out(x) cout << x << endl
#define exout(x) printf("%.10f\n", x)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define pb push_back
#define re0 return 0
const ll mod = 1000000007;
const ll INF = 1e16;
const ll MAX_N = 100010;

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

    ll x = max({a, b, c});
    ll sum = a+b+c;

    ll ans;
    if(x%2 == sum%2) {
        ans = (3*x - sum)/2;
    }
    else {
        ans = (3*(x+1) - sum)/2;
    }

    out(ans);
    re0;
}

Measured memory_bytes: 384
count = -1
a = []
while True:
    count += 1
    n = input()
    a.append(n.split())
    boy = a[count][0]
    fuck = a[count][1]
    girl = a[count][2]
    if fuck == "+":
        print(int(boy)+int(girl))
    elif fuck == "-":
        print(int(boy)-int(girl))
    elif fuck == "*":
        print(int(boy)*int(girl))
    elif fuck == "/":
        print(int(int(boy)/int(girl)))
    if a[count][1] == "?":
        break

Measured memory_bytes: 7528
import collections

n,m = map(int,input().split())
a = list(map(int,input().split()))

s = 0
ct = collections.defaultdict(int)
for i in range(n):
    s += a[i]
    ct[s%m] += 1

s = 0
ans = 0
for i in range(n):
    ans += ct[s%m]
    s += a[i]
    ct[s%m] -= 1

print(ans)


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

void init(char t[],int W);
int main(){
  int H,W;
  int i,j;
  cin>>H>>W;
  char a[H][W+1];
  bool flag_h[H];
  bool flag_w[W];
  for(i=0;i<H;i++){
    cin>>a[i];
    flag_h[i]=false;
  }
  for(i=0;i<W;i++){
    flag_w[i]=false;
  }
  printf("\n");

  for(i=0;i<H;i++){
    if(a[i][0]=='.'){
      for(j=0;j<W;j++){
        if(a[i][j]=='#'){
            flag_h[i]=true;
            break;
        }
      }
    }else flag_h[i]=true;
  }

  for(i=0;i<W;i++){
    if(a[0][i]=='.'){
      for(j=0;j<H;j++){
        if(a[j][i]=='#'){
          flag_w[i]=true;
        }
      }
    }else flag_w[i]=true;
  }
  
  for(i=0;i<H;i++){
    if(flag_h[i]){
      for(j=0;j<W;j++){
        if(flag_w[j]){
          cout<<a[i][j];
        }
      }
      cout<<endl;
    }
  }

  return 0;
}


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

int main(){
  int n;
  cin >> n;
  int x[3][10],y[3][10],z[3][10],w[3][10];

  for(int i=0;i<3;i++){
    for(int j=0;j<10;j++){
      x[i][j] = 0;
      y[i][j] = 0;
      z[i][j] = 0;
      w[i][j] = 0;
    }
  }

  int b,f,r,v;
  for(int i=0;i<n;i++){
    cin >> b >> f >> r >> v ;
    switch(b){
      case 1:
        x[f-1][r-1] += v;
        break;
      case 2:
        y[f-1][r-1] += v;
        break;
      case 3:
        z[f-1][r-1] += v;
        break;
      case 4:
        w[f-1][r-1] += v;
        break;
    }
  }

  for(int i=0;i<3;i++){
    for(int j=0;j<10;j++){
      cout << " " << x[i][j];
    }
    cout << endl;
  }
  cout << "####################" << endl;

  for(int i=0;i<3;i++){
    for(int j=0;j<10;j++){
      cout << " " << y[i][j];
    }
    cout << endl;
  }
  cout << "####################" << endl;

  for(int i=0;i<3;i++){
    for(int j=0;j<10;j++){
      cout << " " << z[i][j];
    }
    cout << endl;
  }
  cout << "####################" << endl;

  for(int i=0;i<3;i++){
    for(int j=0;j<10;j++){
      cout << " " << w[i][j];
    }
    cout << endl;
  }

  return 0;
}



Measured memory_bytes: 3100
a, b = map(int, input().split())

grid = [["."]*100 for _ in range(50)] + [["#"]*100 for _ in range(50)]

for i in range(0, 50, 2):
  flag = False
  for j in range(0, 50, 2):
    if b > 1:
      b -= 1
      grid[i][j] = "#"
    if b == 1:
      flag = True
      break
  if flag:
    break

for i in range(99, 50, -2):
  flag = False
  for j in range(99, 50, -2):
    if a > 1:
      a -= 1
      grid[i][j] = "."
    if a == 1:
      flag = True
      break
  if flag:
    break
    

print(100, 100)
for i in range(100):
  print("".join(grid[i]))

Measured memory_bytes: 3188
#include<stdio.h>

#define N 1000000

int main(){
  int num,i,j;
  int Par[N];
  int x;
  int temp;
  int p,r;
  int a;

  scanf("%d",&num);
  for(i=0;i<num;i++) scanf("%d",&Par[i]);

  p = 0;
  r = num-1;
  
  x = Par[r];
  i = p - 1;

  for(j = p;j<=r-1;j++){
    if(Par[j] <= x ){
      i = i+1;
      // A[i] と A[j] を交換
      temp = Par[i];
      Par[i] = Par[j];
      Par[j] = temp;
    }
  }
    //A[i+1] と A[r] を交換
    temp = Par[i+1];
    Par[i+1] = Par[r];
    Par[r] = temp;

    a = i+1;

  for(i=0;i<num;i++){
    if(i) printf(" ");
    if(i == a) printf("[%d]",Par[i]);
    else printf("%d",Par[i]);
  }
  printf("\n");

  return 0;
}



Measured memory_bytes: 3056
<?php
	$str = trim( fgets( STDIN ) );
	$n = trim( fgets( STDIN ) );
	while( $n-- ) {
		$cmds = explode( " ", trim( fgets(STDIN) ) );
		$s = $cmds[1];
		$e = $cmds[2];
		$len = $e-$s+1;
		if( "print" == $cmds[0] ) {
			print substr( $str, $s, $len ).PHP_EOL;
		} else if( "reverse" == $cmds[0] ) {
			$str = substr( $str, 0, $s ).strrev( substr( $str, $s, $len ) ).substr( $str, $e+1 );
		} else if( "replace" == $cmds[0] ) {
			$str = substr( $str, 0, $s ).$cmds[3].substr( $str, $e+1 );
		}
	}
	return;
?>

Measured memory_bytes: 15472
#include <iostream>

using namespace std;

main(){
  int n;
  while(cin >> n && n){
    int sum = 0;
    for(int i=1;i*i<=n;i++){
      if(n%i==0){
	sum += i + n/i;
	if(i*i == n) sum -= i;
      }
    }
    if(sum == 2*n) cout << "perfect number" << endl;
    else if(sum < 2*n) cout << "deficient number" << endl;
    else cout << "abundant number" << endl;
  }
  return 0;
}

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



int main()
{
    int n;
    cin>>n;
    int arr[n+5];
    for(int i=0;i<n;i++)cin>>arr[i];
  int counter=1,bre=0,flag=0;

  for(int i=0;i<n;i++)
  {
     if(arr[i]==counter)
     {
         counter++;
         if(arr[i]==1)flag++;
     }
     else bre++;
  }
  if(flag>0)cout<<bre<<endl;
   else cout<<-1<<endl;
}


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

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

  long i, min = 1e10, max = -1e10;
  for (int t = 0; t < n; t++) {
    std::cin >> i;
    max = std::max(max, i - min);
    min = std::min(min, i);
  }
  std::cout << max << std::endl;
}



Measured memory_bytes: 3116
#include<iostream>
#include<cmath>
#include<cstdio>
using namespace std;
int main(){
	int n;
	while(cin>>n){
		if(n==-1) break;
		double angle=0.0;
		for(int i=2; i<=n; i++){
			angle += atan(1.0/sqrt(i-1.0));
		}
		printf("%.2f\n",sqrt(n)*cos(angle));
		printf("%.2f\n",sqrt(n)*sin(angle));
	}
	return 0;
}

Measured memory_bytes: 0
#include <iostream>
#include <cstdio>
#include <queue>
#include <stack>
#include <vector>
#include <algorithm>
#include <string>
#include <cstring>
#include <cmath>
#include <complex>
#include <map>
#include <climits>
#include <sstream>
using namespace std;

#define reep(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) reep((i),0,(n))
#define ALL(v) (v).begin(),(v).end()
#define PB push_back
#define EPS 1e-8
#define F first
#define S second
#define mkp make_pair

static const double PI=6*asin(0.5);
typedef long long ll;
typedef complex<double> CP;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vint;
static const int INF=1<<24;

template <class T>
void initvv(vector<vector<T> > &v,int a,int b, const T  &t = T()){
	v.assign(a,vector<T>(b,t));
}

//v.erase(unique(v.begin(),v.end()),v.end());


int main(){
	int N;
	cin>>N;
	rep(l,N){
		int n,k;
		cin>>n>>k;
		vint v;
		int s;
		cin>>s;
		int ans=0;
		rep(i,n-1){
			int t;
			cin>>t;
			// ans+=t-s;
			v.PB(t-s);
			s=t;
		}
		sort(ALL(v));
		if(n<=k) ans=0;

		else rep(i,v.size()-k+1){
			ans+=v[i];
		}
		cout<<ans<<endl;
	}
}

Measured memory_bytes: 1864
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cmath>
#include <list>
#include <map>
#include <set>
#include <queue>
using namespace std;

priority_queue<unsigned long long> que;

int main(void) {
	unsigned long long n,m,d;
	scanf("%llu %llu",&n,&m);
	for(int i = 0;i < n;i ++) {
		scanf("%llu",&d);
		que.push(d);
	}
	for(int i = 0;i < m;i ++) {
		d = que.top();
		que.pop();
		que.push(d / 2);
	}
	d = 0;
	while(que.size()) {
		d += que.top();
		que.pop();
	}
	cout << d << endl;
	return 0;
}


Measured memory_bytes: 1400
#include<iostream>
#include<iomanip>
#include<vector>
#include<string>
#include<algorithm>
#include<cmath>
#include<functional>
#include<map>
#include<cstdlib>
#include<complex>
#include<numeric>
#include<set>
#include<deque>
#include<queue>

using namespace std;
using Int = long long;
Int INF = 1LL << 60;
const Int MOD = 1000000000 + 7;

vector<Int> s;//累積和
Int N;

bool isOK_R(Int x, Int i) {//x回の攻撃で全滅するかどうか

	if (s[x] - s[i] < s[N] - s[x]) {
		return true;
	}
	else {
		return false;
	}
}

Int binary_search_R(Int i) {
	Int ng = N;
	Int ok = i+1; 

	/* ok と ng のどちらが大きいかわからないことを考慮 */
	while (abs(ok - ng) > 1) {
		Int mid = (ok + ng) / 2;

		if (isOK_R(mid, i)) ok = mid;
		else ng = mid;
	}
	return ok;
}

bool isOK_L(Int x,Int i) {//x回の攻撃で全滅するかどうか

	if (s[x]-s[0]<s[i]-s[x]) {
		return true;
	}
	else {
		return false;
	}
}

Int binary_search_L(Int i) {
	Int ng = i; // 0が条件を満たすこともあるので、初期値は -1
	Int ok = 1; // 考えられる答えの上限

	/* ok と ng のどちらが大きいかわからないことを考慮 */
	while (abs(ok - ng) > 1) {
		Int mid = (ok + ng) / 2;

		if (isOK_L(mid,i)) ok = mid;
		else ng = mid;
	}
	return ok;
}

int main() {

	cin.tie(nullptr);
	ios::sync_with_stdio(false);

	cin >> N;

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

	s.resize(N + 1);
	for (Int i = 0; i < N; i++) {
		s[i + 1] = s[i] + A[i];
	}

	Int ans = INF;
	Int tempL, tempR;
	Int mx, mn;
	for (Int i = 2; i <= N - 2; i++) {//真ん中の切れ目
		//左半分の最適化
		tempL = binary_search_L(i);
		if (abs(s[tempL] - (s[i] - s[tempL])) > abs(s[tempL + 1] - (s[i] - s[tempL + 1]))) {
			tempL++;
			/*if (tempL==i) {
				tempL--;
			}*/
		}

		//右半分の最適化
		tempR = binary_search_R(i);
		if (abs((s[N]-s[tempR]) - (s[tempR] - s[i])) > abs((s[N]-s[tempR+1]) - (s[tempR+1] - s[i]))) {
			tempR++;
			/*if (tempR==N) {
				tempR--;
			}*/
		}

		mx = max({ s[tempL],s[i] - s[tempL],s[tempR] - s[i],s[N] - s[tempR] });
		mn = min({ s[tempL],s[i] - s[tempL],s[tempR] - s[i],s[N] - s[tempR] });

		ans = min(ans, mx - mn);

	}

	cout << ans << "\n";

}


Measured memory_bytes: 3328
#include <algorithm>
#include <iostream>
#include <map>
#include <vector>

using namespace std;

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

  vector<int> left_west(n+1,0); // iより左にWが何個あるか
  for (int i = 1; i < n; i++) {
    left_west[i] = left_west[i-1];
    if (s[i-1] == 'W') {
      left_west[i]++;
    }
  }
  vector<int> right_east(n+1,0); // iより右にEが何個あるか
  for (int i = n-2; i >= 0; i--) {
    right_east[i] = right_east[i+1];
    if (s[i+1] == 'E') {
      right_east[i]++;
    }
  }
  int ans = 300005;
  for (int i = 0; i < n; i++) {
    ans = min(ans, left_west[i] + right_east[i]);
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 3076
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<vector>
#include<set>
#include<map>
#include<string>
#include<functional>
#include<queue>
#include<stack>
#include<math.h>
#define INF (1 << 30) - 1 + (1 << 30)
#define EPS 1.0e-6

using namespace std;

typedef pair<int, int> P;
int n;
vector<P> primefactor;

int main()
{
	cin >> n;
	primefactor.push_back(P(2,1));
	for (int i = 3; i <= n; i++) {
		int ope = 1;
		int k = i;
		for (int j = 0; j < primefactor.size();j++) {
			//if (primefactor[j].first * primefactor[j].first > k)break;
			
			while (k % primefactor[j].first == 0) {
				ope = 0;
				primefactor[j].second++;
				k /= primefactor[j].first;

			}
		}
		if (ope == 1) {
			primefactor.push_back(P(i, 1));
		}
	}
	long long ans=1;
	if (n >= 2) {
		for (int i = 0; i < primefactor.size(); i++) {
			ans *= primefactor[i].second + 1;
			ans %= 1000000007;
		}
	}
	cout << ans << endl;

	return 0;
}



Measured memory_bytes: 256
import math

a, b, x = map(int, input().split())
if b * (a ** 2) <= 2 * x:
    ans = math.atan((2*(b * (a ** 2)-x)) / (a ** 3))
else:
    ans = math.atan((a * (b ** 2)) / (2*x))
print(math.degrees(ans))

Measured memory_bytes: 3060
n,a,b,c,d = map(int,input().split())
mod = 10**9 + 7

max = 2 * 10**3
fac, finv, inv = [0]*max, [0]*max, [0]*max

def comInit(max):
    fac[0] = fac[1] = 1
    finv[0] = finv[1] = 1
    inv[1] = 1

    for i in range(2,max):
      fac[i] = fac[i-1]* i% mod
      inv[i] = mod - inv[mod%i] * (mod // i) % mod
      finv[i] = finv[i-1] * inv[i] % mod

comInit(max)

# 二項係数の計算
def com(n,k):
    if(n < k):
        return 0
    if( (n<0) | (k < 0)):
        return 0
    return fac[n] * (finv[k] * finv[n-k] % mod) % mod

dp = [[0] * (n+1) for _ in range(b+2)]

for i in range(a,b+1):
    dp[i][0] = 1
    for j in range(n+1):
        com_num = 1
        dp[i+1][j] += dp[i][j]
        dp[i+1][j] %= mod
        for k in range(j+i,n+1,i):
            k_ind = (k-j)//i
            com_num *= com(n-k+i,i)
            com_num %= mod
            if(c <= k_ind <= d):
                dp[i+1][k] += dp[i][j] * com_num * finv[k_ind]
                dp[i+1][k] %= mod

print(dp[b+1][-1])

Measured memory_bytes: 155556
import java.util.*;

class Main {
   public static void main(String[] args)
   {
      Scanner scan = new Scanner(System.in);

      long[] Luca = new long[87];
      int    N    = scan.nextInt();
      Luca[0] = 2;
      Luca[1] = 1;
      for(int i = 2; i < N + 1; i++){
          Luca[i] = Luca[i - 1] + Luca[i - 2];
          }
      System.out.println(Luca[N]);
   }
}


Measured memory_bytes: 21844
//abc073_b Theater


#include <bits/stdc++.h>
using namespace std;

int main()
{
int i;
int N;
int L;
int R;
int iSum;

	cin >> N;

	iSum = 0;
	for( i = 0; i < N; i++ )
	{
		cin >> L;
		cin >> R;
		iSum += R - L + 1;
	}

	cout << iSum << endl;

	return 0;
}






Measured memory_bytes: 256
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
	Scanner sc=new Scanner(System.in);
	int n=sc.nextInt();
	int d=sc.nextInt();
	int d_2=d*2+1;
	if(n%d_2!=0) {
		System.out.println((n/d_2)+1);
	}else {
		System.out.println(n/d_2);
	}
}
}

Measured memory_bytes: 21844
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        var N = Integer.parseInt(scanner.next());
        var A = new int[N];
        var A_max = 0;
        for (int i = 0; i < N; ++i) {
            A[i] = Integer.parseInt(scanner.next());
            if (A_max < A[i]) A_max = A[i];
        }
        Arrays.parallelSort(A);
        var isP = new boolean[A_max + 1];
        var checked = new boolean[A_max + 1];
        for (int i = 0; i <= A_max; ++i) {
            isP[i] = true;
            checked[i] = false;
        }
        for (int i = 0; i < N; ++i) {
            if (checked[A[i]]) {
                isP[A[i]] = false;
                continue;
            }
            checked[A[i]] = true;
            for (int mul = A[i] * 2; mul <= A_max; mul += A[i])
                isP[mul] = false;
        }
        int numP = 0;
        for (int i = 0; i < N; ++i) if (isP[A[i]]) ++numP;
        System.out.println(numP);
    }
}


Measured memory_bytes: 61220
#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
#include <iostream>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
#include <iomanip>
#include <string>
#include <deque>
#include <stack>
#include <cmath>

using namespace std;

#define PB push_back
#define MP make_pair
#define f first
#define s second
#define FOR(i,a,b) for (LL i = a; i < b; ++i)
#define RFOR(i, b, a) for (int i = b-1; i>=a; --i)
#define FILL(a, b) memset(a, b, sizeof a)
#define ALL(a) a.begin(), a.end()
#define SZ(a) (int)a.size()

typedef long long LL;
typedef pair<int, int> PII;
typedef vector<LL> VI;
typedef pair<LL, LL> PLL;

const int INF = 1000 * 1000 * 1000;
const LL LINF = 1LL * INF*INF;
const int MAX = 400040	;
const long double PI = acos(-1.);
const double EPS = 1e-6;
LL mod = 1000LL * 1000 * 1000 + 7;

string s,t;
LL dpT[3000][3000];
LL dp(int posS,LL posT)
{
	if(posS==SZ(s) || posT==SZ(t))
		return 0;
	if(dpT[posS][posT]!=-1)
		return dpT[posS][posT];
	if(s[posS]==t[posT])
		return dpT[posS][posT]=1+dp(posS+1,posT+1);
	return dpT[posS][posT]=max(dp(posS+1,posT),dp(posS,posT+1));
}



int main()
{
	//freopen("input.tXXt", "r", stdin);
	ios_base::sync_with_stdio(0);
	FILL(dpT,-1);
	cin >> s >> t;
	dp(0,0);
	string ans="";
	int pS=0,pT=0;
	while(pS!=SZ(s) && pT!=SZ(t))
	{
		if(s[pS]==t[pT])
		{
			ans+=s[pS];
			pS++;pT++;
		}
		else
			if(dp(pS+1,pT)==dp(pS,pT))
				pS++;
			else
				pT++;
	}
	cout<<ans;


	return 0;
}


Measured memory_bytes: 70912
#include <bits/stdc++.h>
using namespace std;
using vi=vector<int>;
using vvi=vector<vi>;
using vs=vector<string>;
using msi=map<string,int>;
using mii=map<int,int>;
using pii=pair<int,int>;
using vlai=valarray<int>;
using ll=long long;
#define rep(i,n) for(int i=0;i<n;i++)
#define range(i,s,n) for(int i=s;i<n;i++)
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()

int main(void){
    int n;
    while(cin>>n,n){
        vi p(26,0);
        rep(i,n){
            char s;
            cin>>s;
            p[s-'A']++;
            auto t=p;
            sort(rall(t));
            if(t[0]>t[1]+n-i-1){
                int index=find(all(p),t[0])-p.begin();
                cout<<(char)('A'+index)<<" "<<i+1<<endl;
                string s2;
                getline(cin,s2);
                break;
            }
        }
        sort(rall(p));
        if(p[0]==p[1])cout<<"TIE"<<endl;
    }
}

Measured memory_bytes: 3136
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<=n;++i)
#define all(a) a.begin(),a.end()

int main(void){
    int N,M;
    while(cin>>N>>M,N|M){
        vector<pair<int,int>> a(N+1),b(N+1); //max,min
        rep1(i,N) a[i].second=b[i].second=i;
        rep(i,M){
            int s,k,c;
            cin>>s>>k;
            rep(j,k){
                cin>>c;
                if(k==1) b[c].first += s;
                a[c].first += s;
            }
        }
        sort(all(a));
        sort(all(b));
        if(a[N].second == b[1].second){
            cout<<max(a[N].first-b[2].first,a[N-1].first-b[1].first)+1<<endl;
        }else{
            cout<<a[N].first-b[1].first+1<<endl;
        }
    }
    return 0;
}

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

int main() {
  string S;
  cin >> S;
  if(!S.substr(2,1).compare(S.substr(3,1)) && !S.substr(4,1).compare(S.substr(5,1))){
    cout << "Yes";
  }else{
    cout << "No";
  }

  return 0;
}

Measured memory_bytes: 256
#pragma once
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <iostream>
#include <utility>
#include <set>
#include <cctype>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <deque>
#include <numeric>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int INF = 10e9;
ll gcd(ll a, ll b) {
	if (a % b == 0) return b;
	return gcd(b, a % b);
}
ll lcm(ll a, ll b) {

	if (a < b) {
		return a * (b / gcd(b,a));
	}
	return b * (a / gcd(a, b));
}
void MultipleClocks() {
	int n;
	cin >> n;
	ll lc = 1;
	for (size_t i = 0; i < n; i++)
	{
		ll t;
		cin >> t;
		lc = lcm(lc, t);
	}

	cout << lc << endl;

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



Measured memory_bytes: 256
# import itertools
# import math

import sys
input = sys.stdin.readline


def solve(N):
    return 3 * N ** 2


N = int(input())
# S = input()
# A, B = map(int, input().split())
# A = list(map(int, input().split()))

# P = []
# S = []
# for i in range(N):
#     pp, ss = map(int, input().split())
#     P.append(pp)
#     S.append(ss)

print(solve(N))


Measured memory_bytes: 2940
# include <iostream>

using namespace std;

int main(){
    char c;
    cin >> c;

    if(c == 'a'|| c == 'i' ||c == 'u' ||c == 'e' || c == 'o'){
        cout << "vowel" << endl;
    }
    else{
        cout << "consonant" << endl;
    }
}

Measured memory_bytes: 3576
s = input()
n = len(s)
c = 0
for i in range(n):
    if i % 2 == 0:
        if s[i] == '1':
            c += 1
    else:
        if s[i] == '0':
            c += 1

d = 0
for i in range(n):
    if i % 2 == 0:
        if s[i] == '0':
            d += 1
    else:
        if s[i] == '1':
            d += 1

print(min(c,d))


Measured memory_bytes: 3188
#include <algorithm>
#include <bits/stdc++.h>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;

#define rep(X, Y) for (int(X) = 0; (X) < (Y); ++(X))
#define rrep(X, Y) for (int(X) = (Y)-1; (X) >= 0; --(X))
#define all(X) (X).begin(), (X).end()
#define pb push_back
#define mp make_pair
#define fi first
#define sc second
#define print(x) cout << x << endl

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};

void solve(long long N, std::vector<long long> A, std::vector<long long> B) {
  vl C(N);

  priority_queue<pll> pq;

  // 足りないところは補填する
  ll supplied = 0;
  rep(n, N) {
    if (A[n] < B[n]) {
      C[n] = B[n];
      supplied += B[n] - A[n];
    } else {
      C[n] = A[n];
      if (A[n] - B[n] != 0) {
        pq.push(mp(A[n] - B[n], n));
      }
    }
  }

  // 補填するときは、差が少ないところから
  while (!pq.empty() && supplied > 0) {
    pll top = pq.top();
    ll minus = min(supplied, top.first);
    ll n = top.second;
    C[n] = A[n] - minus;
    supplied -= minus;
    pq.pop();
  }

  if (supplied > 0) {
    print(-1);
    return;
  }

  // iの個数を取得する
  ll ans = 0;
  rep(n, N) {
    if (A[n] != C[n]) {
      ans++;
    }
  }
  print(ans);
}

int main() {
  long long N;
  scanf("%lld", &N);
  std::vector<long long> A(N);
  for (int i = 0; i < N; i++) {
    scanf("%lld", &A[i]);
  }
  std::vector<long long> B(N);
  for (int i = 0; i < N; i++) {
    scanf("%lld", &B[i]);
  }
  solve(N, std::move(A), std::move(B));
  return 0;
}


Measured memory_bytes: 3704