akhauriyash/Code-Regression huggingface dataset:
//### In The Name Of GOD ###

//%% Remember; (((He))) is The (((Accepter))) %%

// GOD IS GREATER ...

#include <bits/stdc++.h>

using namespace std;

typedef long long ll ;
typedef long double ld ;

//#define int ll
#define pb push_back
#define bp pop_back
#define pf push_front
#define fp pop_front
#define X first
#define Y second
#define IO ios_base::sync_with_stdio(false);
#define sz(a) (int)(a.size())
#define sg(a, b) (a + b - 1) /b

const int MOD = 1000 * 1000 * 1000 + 7;
const int INF = 1 * 1000 * 1000 * 1000 + 200;
const int MLOG = 31;
const int SQ = 400;
const int MAXN = SQ * SQ * 2;

vector < int > out[MAXN], inn[MAXN];
int mn = INF, a[MAXN], par[MAXN], dig[MAXN], mark[MAXN];

void I_am_here(int v) {
	mark[v] = true;
	for(int i : out[v])
		dig[i]--;
}

void dfs(int v = 0) {
	I_am_here(v);
	for(auto i : out[v]) {
		if(!mark[i] && !dig[i])
			par[i] = v, dfs(i);
	}
}

signed main() {
	int n, m;
	cin >> n >> m;
	for(int i = 0; i < n + m - 1; i++) {
		int a, b;
		cin >> a >> b;
		a--, b--;
		inn[b].pb(a);
		out[a].pb(b);
		dig[b]++;
	}
	int root = 0;
	for(int i = 0; i < n ; i++)
		if(dig[i] == 0)
			root = i;
	dfs(root);
	par[root] = -1;
	for(int i = 0; i < n; i++)
			cout << par[i] + 1 << endl;
}


Measured memory_bytes: 28928
/*01 02 03 12 13 23　と６回見ていくパターン 
for(int i=0;i<n-1;i++){
  for(int j=i+1;j<n;j++){
    }
  }
*/
//vector<vector<int>> data(3, vector<int>(4));//int型の2次元配列(3×4要素の)の宣言
//int64_t a;
//10のi乗pow(10, i);
/*string s; stringでの文字列を数字型に変える方法
  cin >> s;
  rep(i,s.size()-2) {
  int a= (s.at(i)-'0')*100 + (s.at(i+1)-'0')*10+ s.at(i+2) -'0';
    */
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main() {
  int d,n;
  cin >> d >>n;
  int a=1;
  rep(i,d) a = a*100;
  if(n==100 && d==0) cout<<101<<endl;
  else if(n==100 && d==1)cout<<10100<<endl;
  else if(n==100 && d==2)cout<<1010000<<endl;
  else cout << a*n<<endl;
}

Measured memory_bytes: 256
fun main(args : Array<String>) {
    var N = readInt()
    var S = readString()
    var chars = S.toCharArray()

    for(c in chars){
        var convertChar:Char
        if( c + N > 'Z' ){
            convertChar = c + N - 26
        }else{
            convertChar = c + N
        }
        print(convertChar)
    }
}

fun readString() = readLine()!!
fun readInt() = readLine()!!.toInt()

Measured memory_bytes: 31832
#include <bits/stdc++.h>
#define REP(i, m, n) for(int (i) = (m); (i) < (n); ++i)
#define rep(i, n) REP(i, 0, n)
#define all(x) (x).begin(), (x).end()
using namespace std;
using Graph = vector<vector<int>>;
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; }
typedef long long ll;
typedef pair<ll, ll> P;
const int INF = 1e9+7;
const ll LINF = 1LL<<60;

int main()
{
    cin.tie(0);
    ios_base::sync_with_stdio(0);
    int a[3], k;
    cin >> a[0] >> a[1] >> a[2] >> k;
    sort(a, a+3);

    cout << a[0] + a[1] + (int)pow(2, k) * a[2] << endl;

    return 0;
}

Measured memory_bytes: 384
import sys

h,w,n=map(int,input().split())
A = [map(int,input().split()) for _ in range(n)]

dict = {}
ans = [0]*10
ans[0] = (w-2)*(h-2)

for item in A:#for every paint
    cord = list(item)
#    print("----{},{}----".format(cord[0],cord[1]))
    #update candidate
    upcand = []#max9
    for i in range(cord[0]-1,cord[0]+2):
        for j in range(cord[1]-1,cord[1]+2):
#            print("----({},{})----".format(i,j))
            upcand.append([i,j])
#    print(upcand)
    for cand in upcand:
#        print(cand)
        if 1 < cand[0] < h and 1 < cand[1] < w:
#            print(cand)
            dict[(cand[0],cand[1])] = dict.get((cand[0],cand[1]), 0) + 1
#        print(dict)
for v in dict.values():
    ans[v] += 1
    ans[0] -= 1

for i in ans:
    print(i)


Measured memory_bytes: 187364
n=int(input())
A=list(map(int,input().split()))
m=int(input())
B=list(map(int,input().split()))
include=len(set(A)^set(B))

if include==abs(len(A)-len(B)) and len(A)>=len(B):
    print(1)
else:
    print(0)



Measured memory_bytes: 69700
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef pair<int, int> pi;
#define debug(x) cerr << #x << ": " << x << endl;
#define debug2(x, y) debug(x) debug(y);
#define repn(i, a, b) for(int i = (int)(a); i < (int)(b); i++)
#define rep(i, a) for(int i = 0; i < (int)(a); i++)
#define all(v) v.begin(), v.end() 
#define mp make_pair
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define fi first
#define se second
#define sq(x) ((x) * (x))
const int MAXN = 200005;

template<class T> T gcd(T a, T b){ return ((b == 0) ? a : gcd(b, a % b)); }

int n;
int p[MAXN], s[4 * MAXN], s1[4 * MAXN];

void build(int id = 1, int l = 0, int r = n){
	if(r - l < 2){
		s[id] = p[l];
		s1[id] = p[l];
		return;
	}
	int mid = (l + r) / 2;
	build(id * 2, l, mid);
	build(id * 2 + 1, mid, r);
	s[id] = min(s[id * 2], s[id * 2 + 1]);
	s1[id] = max(s1[id * 2], s1[id * 2 + 1]);
}

int minQ(int x, int y, int id = 1, int l = 0, int r = n){
	if(x >= r || l >= y) return 1e9;
	if(x <= l && r <= y) return s[id];
	int mid = (l + r) / 2;
	return min(minQ(x, y, id * 2, l, mid), minQ(x, y, id * 2 + 1, mid, r));
}

int maxQ(int x, int y, int id = 1, int l = 0, int r = n){
	if(x >= r || l >= y) return -1e9;
	if(x <= l && r <= y) return s1[id];
	int mid = (l + r) / 2;
	return max(maxQ(x, y, id * 2, l, mid), maxQ(x, y, id * 2 + 1, mid, r));
}

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	//freopen("input.in", "r", stdin);
	//freopen("output.out", "w", stdout);
	int k;
	cin >> n >> k;
	rep(i, n) cin >> p[i];
	memset(s, 0, sizeof(s));
	memset(s1, 0, sizeof(s1));
	build();
	int ans = 0;
	int tot = 0;
	vi vis(n, 0);
	int f = 0;
	rep(i, n){
		if(i && (p[i] < p[i - 1])){
			//creates disorder
			vis[i - 1] = 1;
			tot++;
		}
		if(i >= k){
			if(vis[i - k]) tot--;
			/*
			debug(i);
			debug(p[i - k]);
			debug(p[i]);
			debug(minQ(i - k + 1, i + 1));
			debug(maxQ(i - k + 1, i + 1));
			debug(ans);
			*/
			if((tot || (!tot && !f)) && p[i - k] < minQ(i - k + 1, i + 1) && (p[i] >= maxQ(i - k + 1, i + 1))) ans--;
			//debug(ans);
			//cout << "----" << endl;
		}
		if(i >= (k - 1)){
			if(!tot && !f) f++; //because if we can't have more than 1 sorted segment
			ans += (tot > 0);
		}
	}
	cout << ans + f << endl; //f is for the one that doesn't change
	return 0;
}
/*
Things to look out for:
	- Integer overflows
	- Array bounds
	- Special cases
Be careful!
*/


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

#include<cstdio>
#define r(i,n) for(int i=0;i<n;i++)


int main(void){

  int n,k,now=1;
  cin>>n>>k;

  r(i,n){
    if(now<=k)now*=2;
    else now+=k;
  }
  cout<<now<<endl;



return 0;}


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

//main関数
int main() {
    //入力
    long N,M;
    cin>>N>>M;
    vector<long> K(N);
    vector<vector<long>> A(N,vector<long>(0));
    for(int i=0;i<N;i++){
        cin>>K.at(i);
        for(int j=0;j<K.at(i);j++){
            long a;
            cin>>a;
            A.at(i).push_back(a);
        }
    }
    
    //計算
    vector<bool> ans(M,true);
    for(int i=0;i<N;i++){
        vector<bool> ians(M,false);
        for(int j=0;j<K.at(i);j++){
            ians.at(A.at(i).at(j)-1)=true;
        }
        for(int j=0;j<M;j++){
            ans.at(j)=(ans.at(j) && ians.at(j));
        }
    }
    
    long an=0;
    for(int i=0;i<M;i++){
        an+=(ans.at(i));
    }
    
    //出力
    cout<<an<<endl;
}

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

int main(){
  long long N;
  cin >> N;
  long long minC=N+1;
  for(int i=1;i<=sqrt(N);i++){
    if(N%i==0){
      long long C=i+N/i;
      minC=min(minC,C);
    }
  }
  cout << minC-2 << endl;
}
    

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

int n;
int cnt[86401];

int toSec(string s) {
	int h = (s[0] - '0') * 10 + (s[1] - '0');
	int m = (s[3] - '0') * 10 + (s[4] - '0');
	int sec = (s[6] - '0') * 10 + (s[7] - '0');
	return h * 3600 + m * 60 + sec;
}

int main() {
	while (cin >> n) {
		if (!n) return 0;
		
		int i;
		for (i = 0; i < 86400; i++) cnt[i] = 0;
		for (i = 0; i < n; i++) {
			string s, t;
			cin >> s >> t;
			cnt[toSec(s)]++;
			cnt[toSec(t)]--;
		}
		for (i = 1; i < 86400; i++) cnt[i] += cnt[i - 1];
		int ans = 0;
		for (i = 0; i < 86400; i++) ans = max(ans, cnt[i]);
		cout << ans << endl;
	}
	return 0;
}

Measured memory_bytes: 3404
#include<iostream>
#include<algorithm>
#include<stdlib.h>
using namespace std;
int main() {
	int N;
	cin >> N;
	int foo;
	int b;
	if (N % 2 == 0)foo = N / 2;
	else foo = N / 2 + 1;
	int a[200009];
	for (int i = 1; i <= N; i++) {
		cin >> a[i];
		a[i] -= i;
	}
	long sum = 0;
	sort(a + 1, a + N + 1);
	b = a[foo];
	for (int i = 1; i <= N; i++) {
		sum += abs(a[i] - b);
	}
	cout << sum << endl;
}

Measured memory_bytes: 1024
var
  s: array[0..100000] of char;
  alpha: array[0..128] of byte;
  i: integer;
  ok: boolean;
begin
  read(s);
  for i := 0 to 100000 do
  begin
    alpha[ord(s[i])] := 1;
  end;
  
  ok := False;
  for i := 97 to 122 do
  begin
    if alpha[i] = 0 then
    begin
      write(chr(i));
      ok := True;
      break;
    end;
  end;
  
  if ok = False then
  begin
    write('None');
  end;
end.

Measured memory_bytes: 128
#include<bits/stdc++.h>
#define ll long long
using namespace std;

int main() 
{
    int n;
    cin >> n;
    if (n==1)
        cout << "Hello World";
    if (n==2)
    {
        int a,b;
        cin >> a >> b;
        cout << a+b;
    }
    return 0;
}

Measured memory_bytes: 256
#include<cstdio>
#include<algorithm>

using namespace std;

int main(){
	int n;
	scanf("%d", &n);
	long long t, a, x = 0, y = 0;
	for(int i = 0; i < n; i++){
		scanf("%lld%lld", &t, &a);
		if(x == 0 && y == 0){
			x = t; y = a;
		}else{
			long long p = max(x / t, y / a);
			while(x > t * p || y > a * p){
				p++;
			}
			x = t * p;
			y = a * p;
		}
	}
	printf("%lld\n", x + y);
	return 0;
}

Measured memory_bytes: 128
#define _LIBCPP_DEBUG 0
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
ll MOD = 1e9 + 7;

int main() {

    double N,K; cin>>N>>K;

    vector<double> p(N,0);
    for (int i = 0; i < N; ++i) {
        double tmp; cin>>tmp;
        p[i] = (tmp+1.0)/2.0;
    }


    double maximum = 0;
    for (int i = 0; i < K; ++i) {
        maximum += p[i];
    }
    double sum=maximum;
    for (int i = 1; i < N-K+1; ++i) {
        double p1 = p[i-1];
        double p2 = p[i+(K-1)];
        sum = sum-p[i-1]+p[i+(K-1)];
        maximum = max(maximum, sum);
    }

    printf("%lf", maximum);

    return 0;
}

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

int main() {
  int a, b, c;
  cin >> a >> b >> c;
  int k = a;
  rep(i, b) {
    if (k % b == c) {
      cout << "YES" << endl;
      return 0;
    }
    k += a;
  }
  cout << "NO" << endl;
  return 0;
}

Measured memory_bytes: 3588
import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc =new Scanner(System.in);
    String S =sc.next();
    String T =sc.next();
    String s[] =S.split("",0);
    String t[] =T.split("",0);
    int m=S.length();
    int l =T.length();
    int ans =1000;
    int a=0;
    for(int i=0;i<=m-l;i++){
      for(int j =0;j<l;j++){
        if(s[i+j].equals(t[j])){a=a;}
        else{a =a+1;}
      }
      ans =Math.min(ans,a);
      a=0;}
    System.out.println(ans);
  }
}

Measured memory_bytes: 35792
#include<iostream>
#include<set>
#include<string>
#define M 1000000007ULL
using namespace std;

typedef unsigned long long ull;
set<ull> ans;
ull hash[300100];

int main(){
  int n,m;
  string str,q;
  int l=0,r=1;
  ull c[300100],val;

  cin >> n >> m;
  cin >> str;

  hash[0] = 0;
  c[0] = 1;
  for(int i=1;i<=n;i++){
    c[i] = c[i-1] * M;
    hash[i] = hash[i-1] * M + str[i-1];
  }

  while(m--){
    cin >> q;
    if(q[0] == 'R'){
      if(q[1] == '+')r++;
      else r--;
    }else{
      if(q[1] == '+')l++;
      else l--;
    }
    val = hash[r] - hash[l] * c[r-l];
    ans.insert(val);
  }
  cout << ans.size() << endl;
}

Measured memory_bytes: 20032
#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<vector>
#include<cmath>
#include<algorithm>
#include<map>
#include<queue>
#include<deque>
#include<iomanip>
#include<tuple>
using namespace std;
typedef long long int LL;
typedef pair<int,int> P;
typedef pair<LL,int> LP;
const int INF=1<<30;
const LL MAX=1e9+7;

void array_show(int *array,int array_n,char middle=' '){
	for(int i=0;i<array_n;i++)printf("%d%c",array[i],(i!=array_n-1?middle:'\n'));
}
void array_show(LL *array,int array_n,char middle=' '){
	for(int i=0;i<array_n;i++)printf("%lld%c",array[i],(i!=array_n-1?middle:'\n'));
}
void array_show(vector<int> &vec_s,int vec_n=-1,char middle=' '){
	if(vec_n==-1)vec_n=vec_s.size();
	for(int i=0;i<vec_n;i++)printf("%d%c",vec_s[i],(i!=vec_n-1?middle:'\n'));
}
void array_show(vector<LL> &vec_s,int vec_n=-1,char middle=' '){
	if(vec_n==-1)vec_n=vec_s.size();
	for(int i=0;i<vec_n;i++)printf("%lld%c",vec_s[i],(i!=vec_n-1?middle:'\n'));
}

vector<int> v1[1005];

int main(){
	int n,m;
	int i,j,k;
	int a,b,c;
	cin>>n;
	for(a=0;a<1000;a++){
		b=a*(a-1)/2;
		if(b==n)break;
		if(b>n){
			cout<<"No"<<endl;
			return 0;
		}
	}
	cout<<"Yes"<<endl;
	cout<<a<<endl;
	for(i=0;i<a;i++){
		v1[i].push_back(a-1);
	}
	for(i=0,k=1;i<a;i++){
		for(j=i+1;j<a;j++,k++){
			v1[i].push_back(k),v1[j].push_back(k);
		}
	}
	for(i=0;i<a;i++){
		array_show(v1[i]);
	}
}

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

using namespace std;

using ll = long long;

#define ALL(A) A.begin(),A.end()

void ALLIN1_NUMBER(vector<ll>& V)
{
    for(auto& x : V)
    {
        cin >> x;
    }
}

void ALLOUT_NUMBER(vector<ll> V)
{
    ll N = V.size();
    for(ll i=0;i<N;i++)
    {
        cout << V[i];
        if(i<N-1) cout << ' ';
    }
    cout << endl;
}

template<class T>
void OUT0(T N)
{
    cout << N << endl;
}

static const double pi = acos(-1.0);

double Cos(double D)
{
    return cos(pi/180 * D);
}

int main()
{
    ll X1,X2,X3,X4,X5;
    cin >> X1 >> X2 >> X3 >> X4 >> X5;

    if(X1==0) OUT0(1);
    if(X2==0) OUT0(2);
    if(X3==0) OUT0(3);
    if(X4==0) OUT0(4);
    if(X5==0) OUT0(5);

    return 0;
}

Measured memory_bytes: 3628
from collections import defaultdict
N = int(input())
 
counts = [0,0,0]
for a in map(int,input().split()):
  counts[a-1] += 1

A,B,C = counts


# dp[i][j][k] = 残り1個の皿がi枚、残り2個の皿がj枚、残り3個の皿がk枚のときの回数の期待値
# dp[i][j][k] = (i/N)(dp[i-1][j][k])+(j/N)(dp[i+1][j-1][k])+(k/N)(dp[i][j+1][k-1])+(N-i-j-k/N)(dp[i][j][k])+1
# dp[i][j][k] = (i(dp[i-1][j][k])+j(dp[i+1][j-1][k])+k(dp[i][j+1][k-1])+N)/(i+j+k)
dp = [[[0]*(A+B+C+1-k-j) for j in range(B+C+1-k)] for k in range(C+1)]

t1 = None

for k in range(C+1):
  t0 = dp[k]
  for j in range(B+C+1-k):
    for i in range(A+B+C+1-k-j):
      try:
        dp[k][j][i] =((i*t0[j][i-1] if i else 0)+
                      (j*t0[j-1][i+1] if j else 0)+
                      (k*t1[j+1][i] if k else 0)+
                      N)/(i+j+k)
      except ZeroDivisionError:
        pass
  t1 = t0


print(dp[C][B][A])

Measured memory_bytes: 154504
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
#define int ll
#define double long double
#define YES {cout<<"YES"<<'\n';}
#define NO {cout<<"NO"<<'\n';}
#define Yes {cout<<"Yes"<<'\n';}
#define No {cout<<"No"<<'\n';}
#define yes {cout<<"yes"<<'\n';}
#define no {cout<<"no"<<'\n';}
void YN(bool flg){cout<<(flg?"YES":"NO")<<'\n';}
void Yn(bool flg){cout<<(flg?"Yes":"No")<<'\n';}
void yn(bool flg){cout<<(flg?"yes":"no")<<'\n';}
#define SORT(a) sort(a.begin(),a.end())
#define REVERSE(a) reverse(a.begin(),a.end())
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define out(n) {cout << n << '\n';}
typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<bool> VB;
typedef vector<VI> VVI;
const int MOD = 1000000007;
const long long INF = 10e10;
const double PI = acos(-1.0);
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<class T>auto MAX(const T& a) { return *max_element(a.begin(),a.end()); }
template<class T>auto MIN(const T& a) { return *min_element(a.begin(),a.end()); }
int ABS(int a) {if(a<0) a = -a; return a;}
template<class T, class U>U SUM(const T& a, const U& v) { return accumulate(a.begin(),a.end(), v); }
template<class T, class U>U COUNT(const T& a, const U& v) { return count(a.begin(),a.end(), v); }
template<class T, class U>int LOWER(const T& a, const U& v) { return lower_bound(a.begin(),a.end(), v) - a.begin(); }
template<class T, class U>int UPPER(const T& a, const U& v) { return upper_bound(a.begin(),a.end(), v) - a.begin(); }
int GCD(int a, int b) { return b ? GCD(b, a%b) : a; }
int LCM(int a, int b) { int g = GCD(a, b); return a / g * b; }
int POW(int a, int n) { int r = 1; while (n > 0) { if (n & 1)r *= a; a *= a; n /= 2; }return r; }
int isPrime(int n){if(n<2){return 0;}for(int i=2; i*i<=n; i++){if(n%i==0){return 0;}}return 1;}
/*素因数分解*/map< int, int >prime_factor(int n){map< int, int > ret;for(int i = 2; i * i <= n; i++) {while(n % i == 0) {ret[i]++;n /= i;}}if(n != 1) ret[n] = 1;return ret;}
/*約数の個数*/int divisor_number(int n){auto p = prime_factor(n); int res = 1; for(auto x:p)res*=(x.second+1); return res;}
/*約数列挙*/vector<int> divisor(int n){vector<int> v; for(int i=1; i*i<=n; i++){if(n%i==0){v.push_back(i);if(i!=n/i){v.push_back(n/i);}}}sort(v.begin(),v.end()); return v;}
//----------------ライブラリとか----------------

signed main(){
    cin.tie(0);
    ios::sync_with_stdio(0);
    cout<<fixed<<setprecision(15);

    int n; cin >> n;
    int ans = 0;
    REP(i,n){
        int a; cin >> a;
        while(a>0){
            if(a%2==0){a/=2; ans++;}
            else break;
        }
    }
    out(ans);

    return 0;
}

Measured memory_bytes: 256
import java.util.Arrays;
import java.util.Scanner;

class Main {
    public static void main(String[] z) {
        Scanner s = new Scanner(System.in);
        for (int t, i; (t = s.nextInt() + 1) > 1;) {
            long[] x = new long[t + 1];
            for (i = t; i-- > 1;)
                x[i] = s.nextInt();
            for (Arrays.sort(x); i < t - 2;)
                x[0] += (x[++i + 1] += x[i]);
            System.out.println(x[0]);
        }
    }
}


Measured memory_bytes: 49648
#include <bits/stdc++.h>
#include <vector>
#include <algorithm>
#include <cmath>

using namespace std;

int main(){

	long long int ans=1, di=1000000007;
	int n, m, flag=0;
	vector<int> h;
	vector<long long int> v;

	cin>> n >> m;
	v.resize(n+2);
	h.resize(m);

	for(int i=0;i<m;i++) cin>> h[i];

	v[0]=1;
	v[1]=1;
	v[2]=1;
	for(int i=3;i<n+2;i++) v[i]=(v[i-2]+v[i-1])%di;

	if(m==0){
		cout<< v[n+1] <<endl;
		return 0;
	}

	ans=v[h[0]];
	//cout<< ans << endl;

	for(int i=1;i<m;i++){
		if(h[i]-h[i-1]==1){
			cout<< "0" << endl;
			return 0;
		}
		ans*=v[h[i]-h[i-1]-1];
		ans=ans%di;
	//cout<< ans << endl;
	}

	ans*=v[n-h[m-1]];
	ans=ans%di;

	cout<< ans << endl;


}

Measured memory_bytes: 1408
#include <stdio.h>
int main(void)
{
  int a, b, r, x;
  int count;
  
  while(scanf("%d %d", &a, &b) != EOF) {
      count = 0;
      if(a == 0 && b == 0) {
      break;
      }
      if(a < b){//大きさを考慮
     x = b;
     b = a;
     a = x;
     }
      while(b!=0){//bが0でなければ先に行けると気づけばわざわざrを計算しなくて良い。
          r = a % b;
          a = b;
          b = r;
          count++;
      }
      printf("%d %d\n",a,count);
  }
  
  return(0);
}


Measured memory_bytes: 2104
class UnionFind
  def initialize(n)
    @a = n.times.to_a
  end
  def parent(i)
    until @a[i] == i
      i = @a[i] = @a[@a[i]]
    end
    i
  end
  def unite(i, j)
    @a[parent(j)] = parent(i)
  end
  def united?(i, j)
    parent(i) == parent(j)
  end
end

n, m = gets.split.map &:to_i
edges = m.times.map { gets.split.map { |s| s.to_i - 1 } }
cnt = m.times.count do |i|
  uf = UnionFind.new(n)
  (0...i).each { |j| uf.unite *edges[j] }
  (i+1...m).each { |j| uf.unite *edges[j] }
  !uf.united?(*edges[i])
end
p cnt

Measured memory_bytes: 14308
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define TT pair<long long, long long>
#define ordered_set tree<TT, null_type, less<TT>, rb_tree_tag, tree_order_statistics_node_update>
#define fo(i,n)   for(i=0;i<n;i++)
#define mem(a,i) memset(a,i,sizeof(a))
#define pb push_back
#define mp make_pair
#define For(m) for(auto it = m.begin();it!=m.end();it++)
#define fi first
#define se second
typedef long long ll;
typedef long double mytype;
int main(){
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    //priority_queue <int, vector<int>, greater<int> > pq;
    //cout << fixed << setprecision(9) <<ans<<endl;
    //ordered_set os;//os.order_of_key();//os.find_by_order();
    ll l,r,count,n,m,sum=0,ans=0,i,j,k,tt,t,x,y,z,c,a[200005][4]={},b[200005]={};
    string ss;
    set<ll> s;
    vector<ll> v;
    map<ll,ll> ma;
    cin>>n>>k;
    fo(i,n)
    cin>>a[i+1][0]>>a[i+1][1];
    ll dp[n+2][100000+3];
    fo(i,n+2)
    fo(j,100000+2)
    dp[i][j]=1e15;
    dp[0][0]=0;
    for(i=1;i<=n;i++){
        for(j=0;j<=100000;j++){
            dp[i][j]=min(dp[i][j],dp[i-1][j]);
            if(dp[i-1][j]==1e15)
            continue;
            dp[i][j+a[i][1]]=min(dp[i][j+a[i][1]],dp[i-1][j]+a[i][0]);
        }
    }
    ans=0;
    for(i=0;i<=n;i++){
        for(j=0;j<=100000;j++)
        if(dp[i][j]<=k)
        ans=max(ans,j);
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 86144
<?php
fscanf(STDIN, "%d %d", $n, $max);
$x = $b[0] = 0;
for ($i = 0; $i < $n; $i++) {
	fscanf(STDIN, "%d %d", $w, $v);
	foreach ($b as $p => $q) {
		$w1 = $p + $w;
		$v1 = $q + $v;
		if ($w1 <= $max && (!isset($b[$w1]) || $b[$w1] < $v1)) {
			$b[$w1] = $v1;
			if ($x < $v1) $x = $v1;
		}
	}
}
echo $x;

Measured memory_bytes: 4728
#include <bits/stdc++.h>
using namespace std;
#define forn(i, n) for(int i = 0; i < (int) n; i++)
#define forin(i, a, b) for(int i = a; i < (int) b; i++) 
#define rofin(i, a, b) for(int i = a; i > b; i--)
#define v vector
#define crap ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define debug(i) cout << #i << ": " << i << endl
using ll = long long;
using pii = pair<int, int>;
using vi = vector<int>;

int N, W;
const ll INF = 1e18L + 5;

int main() {
    crap;
    cin >> N >> W;
    vi weight(N), value(N);
    forn(i,N) cin >> weight[i] >> value[i];

    int sum_value = 0;
    forn(i,N) sum_value += value[i];


    vector<ll> dp(sum_value+1, INF);
    dp[0] = 0;
    
    forn(i,N) {
        int w = weight[i], v = value[i];
        
        rofin(value_alr, sum_value - v, -1) {
            dp[value_alr+v] = min(dp[value_alr+v],dp[value_alr]+w);
        }
    }
    ll ans = 0;
    forn(i, sum_value+1) {
        if(dp[i]<=W) {
            ans = max(ans, (ll) i);
        }
    }
    // forn(i, sum_value+1) {
    //     if(dp[i]!=INF) { cout << "dp[" << i << "]: " << dp[i] << " "; }
        
    // } cout << endl;
    cout << ans << endl;
     

}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
using lint = long long;
template<class T = int> using V = vector<T>;
template<class T = int> using VV = V< V<T> >;

int main() {
  cin.tie(nullptr); ios::sync_with_stdio(false);
  int n; cin >> n;
  V<> a(n - 1), b(n - 1);
  VV<> g(n);
  map< pair<int, int>, int > mp;
  for (int i = 0; i < n - 1; ++i) {
    cin >> a[i] >> b[i], --a[i], --b[i];
    g[a[i]].push_back(b[i]);
    g[b[i]].push_back(a[i]);
    mp[{a[i], b[i]}] = i;
    mp[{b[i], a[i]}] = i;
  }
  V<> sz(n);
  auto dfs = [&](const auto& dfs, int v, int p) -> void {
    sz[v] = 1;
    for (int w : g[v]) if (w != p) {
      dfs(dfs, w, v);
      sz[v] += sz[w];
    }
  };
  dfs(dfs, 0, -1);
  V<lint> s(n); for (auto&& e : s) cin >> e;
  V<lint> res(n - 1);
  auto ndfs = [&](const auto& ndfs, int v, int p) -> void {
    for (int w : g[v]) if (w != p) {
      if (n - 2 * sz[w]) res[mp[{v, w}]] = abs(s[v] - s[w]) / abs(n - 2 * sz[w]);
      ndfs(ndfs, w, v);
    }
  };
  ndfs(ndfs, 0, -1);
  for (int i = 0; i < n - 1; ++i) if (!res[i]) {
    int c = a[i];
    V<lint> d(n);
    auto dfs = [&](const auto& dfs, int v, int p) -> void {
      for (int w : g[v]) if (w != p) {
        d[w] = d[v] + res[mp[{v, w}]];
        dfs(dfs, w, v);
      }
    };
    d[c] = 0;
    dfs(dfs, c, -1);
    lint sum = accumulate(begin(d), end(d), 0LL);
    res[i] = (s[c] - sum) / (n / 2);
    break;
  }
  for (lint e : res) {
    cout << e << '\n';
  }
}

Measured memory_bytes: 26752
import sys
input = sys.stdin.readline


def main():
    N = int(input())
    S = input().strip()

    for s in S:
        a = ord(s) + N
        if a > ord('Z'):
            a = ord('A') + a - ord('Z') - 1
        print(chr(a), end="")



if __name__ == '__main__':
    main()



Measured memory_bytes: 4468
import java.util.Scanner;

class Main{

	public static void main(String args[]) {
		Scanner scan = new Scanner(System.in);
		
		String str;
		int ans = 0;
		
		while(scan.hasNext()){
			str = scan.next();
			char[] ch = str.toCharArray();
			
			for(int i = 0; i < ch.length; i++){
				if(ch.length == 1){
					ans++;
					break;
				}
				if(ch[i] != ch[ch.length - i - 1]){
					break;
				}
				if(i >= ch.length / 2){
					ans++;
					break;
				}
			}
		}
		System.out.println(ans);
	}
}

Measured memory_bytes: 25836
#include <bits/stdc++.h>
using namespace std;
int main()
  {double A, B, H, M; cin >> A >> B >> H >> M;
  int m = 60 * H + M;
  double degA = 6.0 * m ;
  double degB = 0.5 * m;
  double radA = degA * M_PI / 180.0;
  double radB = degB * M_PI / 180.0;
  auto x1 = A * cos(radA), y1 = A * sin(radA), x2 = B * cos(radB), y2 = B * sin(radB);
  printf("%.20f\n", sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)));}

Measured memory_bytes: 4104
#include <iostream>
#include <algorithm>
#include <cmath>

using namespace std;

int main() {
    int n, d;
    int x[10][10];
    int ans = 0;
    int cnt = 0;
    cin >> n >> d;
    for (int i=0; i<n; i++) {
        for(int j=0; j<d; j++) {
            cin >> x[i][j];
        }
    }
    for (int i=0; i<n-1; i++) {
        for (int k=i+1; k<n; k++) {
            int dis = 0;
            for (int j=0; j<d; j++) {
                dis += pow(x[i][j]-x[k][j], 2);
            }
            if (dis == pow(int(sqrt(dis)), 2)) ans++;
            cnt++;
        }
    } 
    cout << ans << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define sz(x) int(x.size())
#define show(x) {for(auto i: x){cout << i << " ";} cout << endl;}
using namespace std;
using ll = long long;
using P = pair<int, int>;

int main() {
  int N;
  cin >> N;
  set<int> A;
  rep(i, N) {
    int a;
    cin >> a;
    A.insert(a);
  }
  bool bl = (sz(A) == N);
  if (bl) puts("YES");
  else puts("NO");
  return 0;
}

Measured memory_bytes: 13012
#include<bits/stdc++.h>
using namespace std; 
typedef long long ll;
typedef long double ld;
#define fr first
#define sc second
#define pb push_back
const ll mod = 998244353;
const int N = 1e6+205;
void solve(){
	int x,y,z; 
	cin>>x>>y>>z; 
	x-=z;
	cout<<x/(y+z)<<endl;
}
int 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: 3668
#include<bits/stdc++.h>
using namespace std;
long long int a[1000100];
long long int b[1000100];
int main()
{
	long long int n,i,ans = 0;
	memset(a,0,sizeof(a));
	memset(b,0,sizeof(b));
	scanf("%lld",&n);
	for(i=0;i<=n;i++)
	{
		scanf("%lld",&a[i]);
		b[i]=1e18;
	}
	b[0]=1;
	if(b[0]<a[0])
	{
		printf("-1");
		return 0;
	}
	for(i=0;i<n;i++)
	{
		b[i+1]= (b[i]-a[i])*2;
		if(b[i]<0)
		{
			printf("-1");
			return 0;
		}
		if(b[i]>=1e18) break;
	}
	if(a[n]>b[n])
	{
		printf("-1");
		return 0;
	}
	long long int now;
	b[n]=ans=now=a[n];

	for(i=n-1;i>=0;i--)
	{
		now=min(now,b[i]-a[i])+a[i];
		ans+=now;
	}
	printf("%lld\n",ans);
}

Measured memory_bytes: 19452
#include <vector>
#include <iostream>
#include <queue>

using namespace std;

const int MAX=100001;

vector<int> G[MAX];
//distance from 1 or N
int n,d_1[MAX],d_n[MAX];

void bfs_1(){
  queue<int> Q;
  int visited[n+1];
  for(int i=1;i<=n;i++) visited[i]=0;
  visited[1]=1;
  d_1[1]=0;
  Q.push(1);
  while(Q.empty()==false){
    int u=Q.front(); Q.pop();
    for(int i=0;i<G[u].size();i++){
      if(visited[G[u][i]]==0){
        visited[G[u][i]]=1;
        d_1[G[u][i]]=d_1[u]+1;
        Q.push(G[u][i]);
      }
    }
  }
}
void bfs_n(){
  queue<int> Q;
  int visited[n+1];
  for(int i=1;i<=n;i++) visited[i]=0;
  visited[n]=1;
  d_n[n]=0;
  Q.push(n);
  while(!Q.empty()){
    int u=Q.front(); Q.pop();
    for(int i=0;i<G[u].size();i++){
      if(visited[G[u][i]]==0){
        visited[G[u][i]]=1;
        d_n[G[u][i]]=d_n[u]+1;
        Q.push(G[u][i]);
      }
    }
    visited[u]=1;
  }
}

int main(){
  cin >> n;
  for(int i=0;i<n-1;i++){
    int a,b; cin >> a >> b;
    G[a].push_back(b);
    G[b].push_back(a);
  }
  bfs_1();
  bfs_n();
  int fennec=0,snuke=0;
  for(int i=1;i<=n;i++){
    if(d_1[i]<=d_n[i]) fennec++;
    else snuke++;
  }
  if(fennec>snuke) cout << "Fennec" << endl;
  else cout << "Snuke" << endl;
}

Measured memory_bytes: 7040
using System;

namespace _168
{
    class Program
    {
        static void Main(string[] args)
        {

            int x = int.Parse(Console.ReadLine()) % 10;
            if(x == 2 || x == 4 || x == 5 || x == 7 || x == 9)
            {
                Console.WriteLine("hon");
            }
            if(x == 0 || x == 6 || x == 1 || x == 8)
            {
                Console.WriteLine("pon");
            }
            if(x == 3)
            {
                Console.WriteLine("bon");
            }
        }
    }
}


Measured memory_bytes: 27540
d = None
f = None


def dfs(g, cur, time):
    global d, f
    d[cur] = time
    for next in g[cur]:
        if d[next] == 0:
            time = dfs(g, next, time+1)
    f[cur] = time + 1
    return time + 1


def main():
    global d, f
    n = int(input())
    g = [[] for _ in range(n)]
    d = [0 for _ in range(n)]
    f = [0 for _ in range(n)]
    for _ in range(n):
        inp = list(map(int, input().split()))
        m = inp[0] - 1
        k = inp[1]
        for i in range(k):
            g[m].append(inp[i+2] - 1)
    time = 1
    for i in range(n):
        if d[i] == 0:
            time = dfs(g, i, time) + 1
    for i in range(n):
        print(i+1, d[i], f[i])


if __name__ == '__main__':
    main()



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

using namespace std;

int64_t calc(std::vector<int64_t>& as) {
  int64_t const n = as.size();
  if (n == 1) {
    return 0;
  }
  for (int64_t i = 0; i < n; ++i) {
    as[i] -= i + 1;
  }
  std::sort(as.begin(), as.end());
  int64_t const b_min = as.front();
  int64_t const b_max = as.back();
  int64_t const b_mid = as[n / 2];
  int64_t sad_mid = 0;
  for (int64_t i = 0; i < n; ++i) {
    sad_mid += std::abs(as[i] - b_mid);
  }
  if (sad_mid == 0) {
    return 0;
  }
  int64_t ret = sad_mid;
  auto const over_b_mid_itr =
      std::upper_bound(as.begin() + n / 2, as.end(), b_mid);
  auto over_b_itr = over_b_mid_itr;
  int64_t over_b_idx = over_b_itr - as.begin();
  int64_t b = b_mid + 1;
  for (; b <= b_max; ++b) {
    int64_t const sad = ret + over_b_idx - (n - over_b_idx);
    if (sad == 0) {
      return 0;
    }
    if (sad > ret) {
      break;
    }
    ret = sad;
    over_b_itr = std::upper_bound(over_b_itr, as.end(), b);
    over_b_idx = over_b_itr - as.begin();
  }
  if (ret == sad_mid) {
    auto ge_b_itr = std::lower_bound(as.begin(), over_b_mid_itr, b_mid);
    int64_t ge_b_idx = ge_b_itr - as.begin();
    b = b_mid - 1;
    for (; b >= b_min; --b) {
      int64_t const sad = ret + (n - ge_b_idx) - ge_b_idx;
      if (sad == 0) {
        return 0;
      }
      if (sad > ret) {
        break;
      }
      ret = sad;
      ge_b_itr = std::lower_bound(as.begin(), over_b_mid_itr, b);
      ge_b_idx = ge_b_itr - as.begin();
    }
  }
  return ret;
}

int main() {
  int64_t n;
  std::cin >> n;
  std::vector<int64_t> as(n);
  for (int64_t i = 0; i < n; ++i) {
    std::cin >> as[i];
  }
  std::cout << calc(as) << std::endl;
  return 0;
}


Measured memory_bytes: 1792
#include <iostream>
#include <string>
#include <set>
#include <cstdio>
#define llint long long

using namespace std;

llint n, w;
llint cnt[105];

int main(void)
{
	while(1){
		cin >> n >> w;
		if(n == 0 && w == 0) break;
		
		for(int i = 0; i < 105; i++) cnt[i] = 0;
		
		llint v, W = 0;
		for(int i = 1; i <= n; i++){
			cin >> v;
			cnt[v / w]++;
			W = max(W, v/w);
		}
		
		llint H = 0;
		for(int i = 0; i <= W; i++) H = max(H, cnt[i]);
		
		double ans = 0.01;
		for(int i = 0; i <= W; i++){
			ans += (double)cnt[i] / H * (W-i) / W;
		}
		printf("%.11f\n", ans);
	}
	
	return 0;
}


Measured memory_bytes: 3172
//“ In order to be irreplaceable, one must always be different”
#include<bits/stdc++.h>
using namespace std;
#define ll long long
# define pi 3.14159265359
# define str string
# define vll vector<ll>
# define vstr vector<str>
# define vchar vector<char>
//assign() assignes new value
//emplace(position,x) inserting
//erase(position) to remove an element
//swap() for swapping
//reverse(position,position) for reversing
# define pb push_back
# define popb pop_back
# define pf push_front
# define popf pop_front
# define sll set<ll>
# define schar set<char>
//find()
//erase(x) removes element x
//erase(position,position)
# define qll queue<ll>
# define qstr queue<str>
//front(),back()
# define stll stack<ll>
# define ststr stack<str>
//top()
# define dll deque<ll>
//at()
# define mll map<ll,ll>
#define mchar map<char, ll>
# define mstr map<str,ll>
# define mss map<str,str>
# define mci map<char,ll>
ll gcd(ll a, ll b) 
{ 
    if (b == 0) 
        return a; 
    return gcd(b, a % b);  
      
} 
ll lcm(ll a, ll b)  
{  
    return (a*b)/gcd(a, b);  
}

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    ll x,y,z;
    cin>>x>>y>>z;
    if(x>y){
        ll m=ceil(double(z)/double(x));
        cout<<m<<endl;
    }
    else{
         ll m=ceil(double(z)/double(y));
        cout<<m<<endl;
    }
   
 
}
   

		
	
	
	
	
	
	
	
	
	
	
	

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

int main(){
  ll n;
  cin >> n;
  ll a[n];
  rep(i,n) cin >> a[i];
  vector<ll> dp(n+1,1000);
  rep(i,n) {
    rep(j,i+1) {
      dp[i+1] = max(dp[i+1],dp[j]/a[j]*a[i]+(dp[j]%a[j]));
    }
  }
  cout << dp[n] << endl;
  return 0;
}


Measured memory_bytes: 3636
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vb=vector<bool>;
using vvb=vector<vb>;
using vd=vector<double>;
using vvd=vector<vd>;
using vi=vector<int>;
using vvi=vector<vi>;
using vl=vector<ll>;
using vvl=vector<vl>;
using pll=pair<ll,ll>;
using tll=tuple<ll,ll>;
using tlll=tuple<ll,ll,ll>;
using vs=vector<string>;
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define rep(i,n) range(i,0,n)
#define rrep(i,n) for(ll i=(n)-1;i>=0;i--)
#define range(i,a,n) for(ll i=(a);i<(n);i++)
#define LINF ((ll)1ll<<60)
#define INF ((int)1<<30)
#define EPS (1e-9)
#define MOD (1000000007ll)
#define fcout(a) cout<<setprecision(a)<<fixed
#define fs first
#define sc second
#define PI (3.1415926535897932384)

int dx[]={1,0,-1,0,1,-1,-1,1},dy[]={0,1,0,-1,1,1,-1,-1};
template<class T>bool chmax(T&a,T b){if(a<b){a=b; return true;}return false;}
template<class T>bool chmin(T&a,T b){if(a>b){a=b; return true;}return false;}
template<class S>S sum(vector<S>&a){return accumulate(all(a),S());}
template<class S>S max(vector<S>&a){return *max_element(all(a));}
template<class S>S min(vector<S>&a){return *min_element(all(a));}
ll max(int a,ll b){return max((ll)a,b);} ll max(ll a,int b){return max(a,(ll)b);}
int sgn(const double&r){return (r>EPS)-(r<-EPS);} // a>0  : sgn(a)>0
int sgn(const double&a,const double&b){return sgn(a-b);} // b<=c : sgn(b,c)<=0

template<class T>void puta(T&&t){cout<<t<<"\n";}
template<class H,class...T>void puta(H&&h,T&&...t){cout<<h<<' ';puta(t...);}
template<class S,class T>void tf(bool b,S t,T f){if(b)puta(t);else puta(f);}
void YN(bool b){tf(b,"YES","NO");}
void Yn(bool b){tf(b,"Yes","No");}
void yn(bool b){tf(b,"yes","no");}
template<class S,class T>ostream&operator<<(ostream&os,pair<S,T>p){os<<"["<<p.first<<", "<<p.second<<"]";return os;};
template<class S>auto&operator<<(ostream&os,vector<S>t){bool a=1;for(auto s:t){os<<(a?"":" ")<<s;a=0;}return os;}
template<class S>auto&operator>>(istream&is,vector<S>&t){for(S&a:t)cin>>a;return is;}

/*他のライブラリを入れる場所*/


int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll a,b;
    cin>>a>>b;
    if(a>b)swap(a,b);
    if(a==1 and b==2) puta(3);
    else if(a==1 and b==3) puta(2);
    else puta(1);
    
    return 0;
}

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

int main()
{
	string s,t;
	while(cin>>s>>t)
	{
		int i,j;
		bool flag=0;
		for(i=0;i<s.size();i++)
		{
			s.insert(0," ");
			s[0]=s[s.size()-1];
			s.erase(s.size()-1);
			if(s==t)
			{
				flag=1;
				cout<<"Yes"<<endl;
				break;
			}
			
		}
		if(flag==0)
			cout<<"No"<<endl;
		
	}
	return 0;
	
}

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

int main() {
  long long N;
  int i ;
  cin >> N ;
  vector<long long> lucaNumberList(N+1);
  lucaNumberList.at(0)=2;
  lucaNumberList.at(1)=1;
  for (i =2;i<=N;i++){
    lucaNumberList.at(i)=lucaNumberList.at(i-1)+lucaNumberList.at(i-2);
  }
  cout << lucaNumberList.at(N) << endl;
      
  // ここにプログラムを追記
}

Measured memory_bytes: 256
#include<stdio.h>
int main()
{
	int s;
	scanf("%d", &s);
	int hour = (s - s % 3600) / 3600;
	int min = (s - hour * 3600 - (s - hour * 3600) % 60) / 60;
	int sec = s % 60;
	printf("%d:%d:%d\n", hour, min, sec);
	return 0;
}

Measured memory_bytes: 592
#include<bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize ("-ffloat-store") // to restrict undesirable precision
#pragma GCC optimize ("-fno-defer-pop")// to pop argument of function as soon as it returns
#define all(a) a.begin(),a.end()
#define ll long long int
#define ld long double
ll power(ll a,ll b,ll m){ if(b==0) return 1; if(b==1) return a%m; ll t=power(a,b/2,m)%m; t=(t*t)%m; if(b&1) t=((t%m)*(a%m))%m; return t;}
ll modInverse(ll a, ll m) { return power(a, m-2, m); }
#define ps push_back
#define fs first
#define sc second
#define takeline cin.ignore();
#define iactive cout.flush();
#define N 40000
#define endl "\n"
#define mod 1000000007
//((1.0l)*BIG MULTIPLY MAGIC?)
// string to integer stoi()
// string to long long stoll()
// string.substr(position,length);
// integer to string to_string();
//-----------------------------------------------
int main(){

	ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
	
	string s;
	cin>>s;
	ll n=s.length(),a=0,b=0,i;
	for(i=0;i<n;i++){
		if(s[i]=='A') a++;
		else b++;
	}
	if(a!=0&&b!=0){
		cout<<"Yes";
	}
	else cout<<"No";
	return 0;
}

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

vector<long> data1;

int main(void){
    long n;
    cin >> n;
    data1 = vector<long>(n);
    for(long i=0;i<n;i++){
        cin >> data1[i];
    }
    sort(data1.begin(),data1.end());
    cout << data1[n/2] - data1[n/2-1] << endl;
    return 0;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define OP_IO ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define fo(i,a,b) for(int i = a; i < b; i++)
#define foi(i,a,b) for(int i = a; i>=b; i--)
#define fi first
#define si second
#define pb push_back
using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<bool> vb;
typedef vector<string> vs;
typedef vector<ll> vll;
typedef pair<int,int> pii;
typedef vector<pii> vpii;

const ll INF = 1e18L + 5;
const int MAXN = 1005;
const ll modn = 1e9+7;

int main(){
  OP_IO;
  int n;
  cin>>n;
  vvi can(n, vi(n));
  fo(i,0,n){
    fo(j, 0, n){
      cin>>can[i][j];
    }
  }
  vi dp(1<<n, 0);
  dp[0] = 1;
  for(int mask = 0; mask < (1<<n)-1; ++mask){
    int a = __builtin_popcount(mask);
    fo(i,0,n){
      if(can[a][i] && !(mask & (1<<i))){
	int m2 = mask ^ (1<<i);
	dp[m2] += dp[mask];
	if(dp[m2] >= modn){
	  dp[m2] -= modn;
	}
      }
    }
  }
  cout<<dp[(1<<n) - 1]<<endl;
  return 0;
}


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

int main(){
	int N, M, X, Y, Z, i, f;
	scanf("%d%d%d%d", &N, &M, &X, &Y);
	int *x = (int *)malloc(sizeof(int) * N);
	for(i = 0; i < N; i++){
		scanf("%d", &x[i]);
	}
	int *y = (int *)malloc(sizeof(int) * M);
	for(i = 0; i < M; i++){
		scanf("%d", &y[i]);
	}
	for(Z = -101; Z <= 101; Z++){
		if(X >= Z || Z > Y){
			continue;
		}
		for(i = 0, f = 1; i < N; i++){
			if(x[i] >= Z){
				f = 0;
			}
		}
		if(f == 0){
			continue;
		}
		for(i = 0, f = 1; i < M; i++){
			if(y[i] < Z){
				f = 0;
			}
		}
		if(f == 0){
			continue;
		}
		printf("No War\n");
		return 0;
	}
	printf("War\n");
	return 0;
}

Measured memory_bytes: 128
#pragma GCC optimize("Ofast,no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
using namespace __gnu_pbds;
using namespace std;
#define IO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define PI 3.1415926535897932384626433832795
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;
long long MOD = 1e9+7;
pair<int,int> dx[4] = {{1,0},{-1,0},{0,1},{0,-1}};
const int RANDOM = chrono::high_resolution_clock::now().time_since_epoch().count();
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
struct chash {int operator()(int x) const { return x ^ RANDOM; }};
string toString(long long x){stringstream ss;ss << x;string str = ss.str();return str;}
long long fastpow(long long x,long long k){if(!k)return 1;if(k & 1)return ((x * fastpow(x,k-1) % MOD) % MOD) % MOD;
long long ans = fastpow(x,k/2);ans %= MOD;ans *= ans;ans %= MOD;return ans;}
long long sumF(long long x){int s = 0;while(x)s += x%10,x /= 10;return s;}
bool isS(char c){return (c >= 'a' && c <= 'z');}
bool isB(char c){return (c >= 'A' && c <= 'Z');}
bool isD(char c){return (c >= '0' && c <= '9');}
bool isSqrt(long long x){ long long f = sqrt((long double)x + 0.5); return f*f == x;}
bool isCubic(long long x) {long long f = cbrt((long double)x + 0.5); return f*f*f == x;}
long long lcm(long long a,long long b){return a * (b / __gcd(a,b));}
vector<long long> divVec(long long x){vector<long long> tmp;for(long long i = 2;1LL*i*i <= x;i++){if(x % i == 0){tmp.push_back(i);if(x / i != i)
tmp.push_back(x / i);}}sort(tmp.begin(),tmp.end());return tmp;}
long long countDiv(long long L,long long R,long long C)
{
    return ((R/C) - ((L-1)/C));
}
int main()
{
    IO;
    long long A,B,C,D;
    cin >> A >> B >> C >> D;
    cout << (B-A+1) - (countDiv(A,B,C) + countDiv(A,B,D) - countDiv(A,B,lcm(C,D)));
    return 0;
}


Measured memory_bytes: 384
#include <algorithm>
#include <cassert>
#include <iostream>
#include <set>
#include <vector>
using namespace std;

int N;
vector<pair<int, int>> values;

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

    cin >> N;
    values.resize(N);
    vector<int> A, B;

    for (int i = 0; i < N; i++) {
        cin >> values[i].second;
        A.push_back(values[i].second);
    }

    for (int i = 0; i < N; i++) {
        cin >> values[i].first;
        B.push_back(values[i].first);
    }

    sort(A.begin(), A.end());
    sort(B.begin(), B.end());

    for (int i = 0; i < N; i++)
        if (A[i] > B[i]) {
            cout << "No" << '\n';
            return 0;
        }

    A.resize(unique(A.begin(), A.end()) - A.begin());
    B.resize(unique(B.begin(), B.end()) - B.begin());

    if ((int) A.size() < N || (int) B.size() < N) {
        cout << "Yes" << '\n';
        return 0;
    }

    sort(values.begin(), values.end());
    int current = 0, cycle_length = 0;

    do {
        current = lower_bound(A.begin(), A.end(), values[current].second) - A.begin();
        cycle_length++;
    } while (current != 0);

    if (cycle_length < N) {
        cout << "Yes" << '\n';
        return 0;
    }

    for (int i = 0; i < N - 1; i++)
        if (A[i + 1] <= B[i]) {
            cout << "Yes" << '\n';
            return 0;
        }

    cout << "No" << '\n';
}


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

#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL)
#define ll long long
#define inf 1e18
#define pi acos(-1.0)

int main()
{
    fastio;

    ll dp[100005][3],n,m=0,i;
    cin >> n;
    dp[0][0]=0;
    dp[0][1]=0;
    dp[0][2]=0;
    for(i=1;i<=n;i++)
    {
        cin >> dp[i][0] >> dp[i][1] >> dp[i][2];
        dp[i][0]+=max(dp[i-1][1],dp[i-1][2]);
        m=max(m,dp[i][0]);
        dp[i][1]+=max(dp[i-1][0],dp[i-1][2]);
        m=max(m,dp[i][1]);
        dp[i][2]+=max(dp[i-1][1],dp[i-1][0]);
        m=max(m,dp[i][2]);
    }
    cout << m;

    return 0;
}


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

int main() {
	int N;
	cin >> N;
	vector<int> d(N);
	for (int& i : d) cin >> i;
	sort(d.begin(), d.end());
	cout << d[N / 2] - d[N / 2 - 1];
}

Measured memory_bytes: 768
# include <bits/stdc++.h>
# define fi first
# define se second
# define mk make_pair
using namespace std;
const int MAX = 2e6 + 1; // 注意可能会取到 2e6+1
const int MAXN = 2e6 + 5;
const int MAXM = 5e3 + 5;
const int MOD = 1e9 + 7;
const int INF = 0x3f3f3f3f;
typedef long long LL;
typedef pair<double, int> PDI;
int A[MAXN], invA[MAXN];


int qpow(int a, int b){
    int res = 1;
    while(b > 0){
        if(b&1)  res = 1LL * res * a % MOD;
        a = 1LL * a * a % MOD;
        b >>= 1;
    }
    return res;
}


void init(){
    A[0] = 1;
    for(int i = 1;i <= MAX; ++i){
        A[i] = 1LL * A[i-1] * i % MOD;
    }
    invA[MAX] = qpow(A[MAX], MOD - 2);
    for(int i = MAX - 1; i >= 0; --i){
        invA[i] = (1LL * invA[i + 1] * (i + 1)) % MOD;
    }
}

int C(int n, int m){
    return 1LL * A[n] * invA[m] % MOD * invA[n-m] % MOD;
}

int f(int r, int c){
    return C(r + c, c);
}

int g(int r, int c){
    int res = 0;
    for(int i = 2; i <= r + 1; ++i){
        res = (1LL * res + 1LL * f(i, c)) % MOD;
    }
    return (1LL * res - r + MOD) % MOD;
}


int calc(int r1, int c1, int r2, int c2){
    int res = 0;
    res = (1LL * res + g(r2, c2)) % MOD;
    if(c1 > 1)  res = (1LL * res - g(r2, c1 - 1) + MOD) % MOD;
    if(r1 > 1)  res = (1LL * res - g(r1 - 1, c2) + MOD) % MOD;
    if(c1 > 1 and r1 > 1)  res = (1LL * res + g(r1 - 1, c1 - 1)) % MOD;
    return res;
}


int main(){
    init();
    int r1, c1, r2, c2;
    scanf("%d%d%d%d", &r1, &c1, &r2, &c2);
    printf("%d\n", calc(r1, c1, r2, c2));
    return 0;
}
/*
2 5 9 14 20 27 35 44 54 65
5 14 28 48 75 110 154 208 273 350
9 28 62 117 200 319 483 702 987 1350
14 48 117 242 451 780 1274 1988 2988 4352
20 75 200 451 912 1703 2989 4990 7992 12359
27 110 319 780 1703 3418 6420 11424 19431 31806
35 154 483 1274 2989 6420 12854 24293 43740 75563
44 208 702 1988 4990 11424 24293 48602 92359 167940
54 273 987 2988 7992 19431 43740 92359 184736 352695
65 350 1350 4352 12359 31806 75563 167940 352695 705410
 */

Measured memory_bytes: 15872
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int mod = (int)1e9 + 7;
const int INF = (int)100100100;

int main() {
    //ll N; cin >> N;
    //ll N,M; cin >> N >> M;
    //string S; cin >> S;
    ll H,W; cin >> H >> W;
    ll sum=0;
    for(int i=0;i<H;i++){
        for(int j=0;j<W;j++){
            char c;
            cin >> c;
            if(c=='#')sum++;
        }    
    }
    if(sum==H+W-1)cout << "Possible";
    else cout << "Impossible";
    


}

/*



 */



Measured memory_bytes: 256