akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <vector>
#include <queue>
#include <stack>
#include <set>
#include <algorithm>
#include <functional>
#include <string>
#include <utility>
#include <cstdio>
#include <cmath>
#include <deque>

#define REP(i,n) for(int i = 0; i < (n); ++i)
#define REP1(i,n) for(int i = 1; i <= (n); ++i)
#define RREP(i, n) for(int i = (n) - 1; i >= 0; --i)
#define ALL(a) begin(a), end(a)
#define MP(a,b) make_pair((a), (b))
#define ROUNDUP(a,b) ((a) / (b) + ((a) % (b) == 0 ? 0 : 1))
#define X first
#define Y second
#define DEBUG(a) cout << #a << ": " << a << "\n"
// #define DEBUG(a) {}

using namespace std;
using ll = long long;
using vi = vector<int>;
using pii = pair<int, int>;

constexpr int MOD = 1e9 + 7;
constexpr int INF = 1e9 + 1;
constexpr ll LLINF = 4 * 1e18 + 1;
// constexpr int INF = 2147483647; // 2 * 1e9
// constexpr ll LLINF = 9223372036854775807; // 9 * 1e18

template<typename T>
T debug(T x) {
	DEBUG(x);
	return x;
}

int main(){
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	ll ans = 0;
	int n;
	cin >> n;
	vi a(n), b(n), c(n);
	vi bb(n); std::fill(ALL(bb), -1);
	REP(i, n) cin >> a[i];
	REP(i, n) cin >> b[i];
	REP(i, n) cin >> c[i];
	sort(ALL(a));
	sort(ALL(b));
	sort(ALL(c));

	REP(i, n){
		ll j, k;
		j = lower_bound(ALL(a), b[i]) - a.begin();
		k = c.end() - upper_bound(ALL(c), b[i]);
		//cout << j << " " << k << "\n";
		ans += j * k;
	}

	cout << ans << "\n";
	return 0;
}


Measured memory_bytes: 1792
#include <iostream>
using namespace std;
int main(int argc, char** argv) {
	int a,b,c;
	cin >> a >> b >> c;
	int ans=0;
	for(int i=b;i<=c;i++)
		if(i%a==0) ans=1;
	if(ans) puts("OK");
	else puts("NG");
	return 0;
}

Measured memory_bytes: 3124
n,m = map(int,input().split())
l = [[0,0] for i in range(n)]
for i in range(m):
  p,s = map(str,input().split())
  p = int(p)-1
  if l[p][1] == 0:
    if s == 'WA':
      l[p][0] += 1
    else:
      l[p][1] += 1
cor = 0
pen = 0
for k in l:
  if k[1] == 1:
    cor += 1
    pen += k[0]
print(cor,pen)

Measured memory_bytes: 53920
#include <vector> 
#include <list> 
#include <map> 
#include <set> 
#include <deque> 
#include <queue> 
#include <stack> 
#include <bitset> 
#include <algorithm> 
#include <functional> 
#include <numeric> 
#include <utility> 
#include <sstream> 
#include <iostream> 
#include <iomanip> 
#include <cstdio> 
#include <cmath> 
#include <cstdlib> 
#include <cctype> 
#include <string> 
#include <cstring> 
#include <ctime> 

using namespace std;

#define _int64 long long

int a[110000];
_int64 d[510000];

void doit(int x,int l,int r,int ll,int rr,int v)
{
  int mid;
  if (r<ll) return;
  if (rr<l) return;
  if ((ll<=l)&&(r<=rr))
  {
    d[x]+=v;
    return;
  }
  mid=(l+r)/2;
  doit(x+x+1,l,mid,ll,rr,v);
  doit(x+x+2,mid+1,r,ll,rr,v);
}

_int64 get1(int x,int l,int r,int p)
{
  _int64 ret;
  int mid;
  if (p<l) return 0;
  if (r<p) return 0;
  ret=d[x];
  mid=(l+r)/2;
  if (r>l)
  {
    ret+=get1(x+x+1,l,mid,p);
    ret+=get1(x+x+2,mid+1,r,p);
  }
  return ret;
}

int main()
{
  int i,j,m,n,tmp,tmp1;
  _int64 tot,best;
  scanf("%d%d",&n,&m);
  for (i=0;i<n;i++)
  {
    scanf("%d",&a[i]);
    a[i]--;
  }
  memset(d,0,sizeof(d));
  for (i=0;i+1<n;i++)
  {
    tmp=a[i];
    if (tmp==a[i+1]) continue;
    tmp++;
    if (tmp==m) tmp=0;
    if (tmp==a[i+1]) continue;
    tmp++;
    if (tmp==m) tmp=0;
    tmp1=a[i+1];
    tmp1++;
    if (tmp1==m) tmp1=0;
    if (tmp<=a[i+1])
    {
      //cout<<"a:"<<tmp<<" "<<a[i+1]<<endl;
      doit(0,0,m-1,tmp,a[i+1],-1);
      doit(0,0,m-1,tmp1,tmp1,a[i+1]-tmp+1);
    }
    else
    {
      //cout<<"a:"<<tmp<<" "<<m-1<<endl;
      //cout<<"a:"<<0<<" "<<a[i+1]<<endl;
      doit(0,0,m-1,tmp,m-1,-1);
      doit(0,0,m-1,0,a[i+1],-1);
      doit(0,0,m-1,tmp1,tmp1,m-tmp+a[i+1]+1);
    }
  }
  tot=0;
  for (i=0;i+1<n;i++)
  {
    tmp=a[i+1]-a[i];
    if (tmp<0) tmp+=m;
    tmp1=a[i+1]+1;
    if (tmp1<tmp) tmp=tmp1;
    tot+=tmp;
  }
  best=tot;
  for (i=1;i<m;i++)
  {
    //cout<<tot<<endl;
    tot+=get1(0,0,m-1,i);
    if (tot<best) best=tot;
  }
  //cout<<tot<<endl;
  printf("%lld\n",best);
  return 0;
}

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

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

  if(b-a+1<=2*k){
    for(int i=0;i<b-a+1;i++){
      cout<<a+i<<endl;
    }
  }
  else{
    for(int i=0;i<k;i++)cout<<a+i<<endl;
    for(int i=0;i<k;i++)cout<<b-k+1+i<<endl;
  }
}

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

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

using ll = long long;
using namespace std;
constexpr ll MOD = ll(1e9) + 7;

ll attack(ll h) {
	ll cnt = 0;
	
	if( h == 1 ) return 1;
	else { 
		cnt++;
		return 2 * attack(h / 2) + 1;
	}
	
	return cnt;
}

int main(void) {
	ll h;
	cin >> h;
	
	ll ans = attack(h);
	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 256
a,b,c=map(int,input().split())
cnt=0
if a==b==c and a%2==0:
  print(-1)

else:
  while a%2==0 and b%2==0 and c%2==0:
    a,b,c = int((b+c)/2), int((a+c)/2), int((a+b)/2)   
    cnt+=1
  print(cnt)

Measured memory_bytes: 9140
import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    n,m=map(int,input().split())
    dp=[10**10]*(1<<n)
    dp[0]=0
    for i in range(m):
        a,b=map(int,input().split())
        C=list(map(int,input().split()))
        d=0
        for c in C:
            d|=1<<(c-1)
        for j in range(1<<n):
            dp[j|d]=min(dp[j|d],dp[j]+a)
    if dp[-1]==10**10:
        print(-1)
    else:
        print(dp[-1])
        
if __name__=='__main__':
    main()

Measured memory_bytes: 42828
#include<iostream>
#include<vector>
#include<algorithm>
#include<tuple>
#include<string>
using namespace std;

bool compare(tuple<string,int,int>a, tuple<string,int,int>b){
  if(get<0>(a) != get<0>(b))  return get<0>(a) < get<0>(b);
  else  return get<1>(a) > get<1>(b);
}

int main(){
  int N;  cin >> N;
  vector<tuple<string,int,int> >res(N);
  for(int i=0;i<N;i++){
    cin >> get<0>(res.at(i)) >> get<1>(res.at(i));
    get<2>(res.at(i)) = i + 1;
  }
  sort(res.begin(),res.end(),compare);
  for(int i=0;i<N;i++){
    cout << get<2>(res.at(i)) << endl;
  }
}


Measured memory_bytes: 256
#include <iostream>
using namespace std;
using ll = long long;
#define repl(i, l, r) for (int i = l; i < r; i++)
#define rep(i, n) repl(i, 0, n)
int main() {
	int n;
	cin >> n;
	ll a[n];
	rep(i, n) cin >> a[i];
	ll now = 1, ans = a[0] - 1;
	repl(i, 1, n) {
		if (a[i] == now + 1)
			now++;
		else
			ans += (a[i] - 1) / (now + 1);
	}
	cout << ans << endl;
	return 0;
}

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

int main(){
  int a,b,k;cin>>a>>b>>k;
  
  if(a+k-1>=b-k+1)
  {
    for(int i=a;i<=b;i++)cout << i << endl;      
  }
  else
  {
    for (int i=a;i<a+k;i++) cout << i << endl;
    for (int i = b-k+1;i<=b;i++)cout << i << endl;
  }
  
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.Contracts;
using System.Linq;

namespace at_coder
{
#if TEST
    [TestClass]
#endif
    public class Test_162_a
    {

#if TEST
        public static void Test_Main()
#else
        public static void Main()
#endif
        {
            int a = ReadInt();
            string s = a.ToString();
            if (s.Contains("7"))
            {
                Write("Yes");
            } 
            else
            {
                Write("No");
            }
        }


        private static void Write(string s)
        {
            Console.WriteLine(s);
        }

        private static int[] ReadIntArray()
        {
            string[] ss = Console.ReadLine().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
            int[] ar = new int[ss.Length];
            for (int i = 0; i < ss.Length; i++)
            {
                ar[i] = int.Parse(ss[i]);
            }
            return ar;
        }
        private static int ReadInt()
        {
            return int.Parse(Console.ReadLine());
        }
        private static void ReadInt(out int a, out int b)
        {
            var ar = ReadIntArray();
            a = ar[0];
            b = ar[1];
        }
        private static void ReadInt(out int a, out int b, out int c)
        {
            var ar = ReadIntArray();
            a = ar[0];
            b = ar[1];
            c = ar[2];
        }
        private static string ReadString()
        {
            return Console.ReadLine();
        }
        private static string[] ReadStringArray()
        {
            string[] ss = Console.ReadLine().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
            return ss;
        }
#if !TEST
    }
}
#endif

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

int main()
{
    int A, B, Q;
    cin >> A >> B >> Q;
    vector<long long> s(A + 1), t(B + 1), x(Q);
    s[0] = -1000000000000000;
    t[0] = -1000000000000000;

    for (int i = 1; i <= A; i++)
    {
        cin >> s[i];
    }
    for (int i = 1; i <= B; i++)
    {
        cin >> t[i];
    }
    for (int i = 0; i < Q; i++)
    {
        cin >> x[i];
    }

    for (int i = 0; i < Q; i++)
    {
        auto itr1 = lower_bound(s.begin(), s.end(), x[i]);
        auto itr2 = lower_bound(t.begin(), t.end(), x[i]);

        long long ans = abs(x[i] - s[itr1 - s.begin() - 1]) + abs(s[itr1 - s.begin() - 1] - t[itr2 - t.begin() - 1]);
        long long tmp = abs(x[i] - s[itr1 - s.begin() - 1]) + abs(s[itr1 - s.begin() - 1] - t[itr2 - t.begin()]);
        ans = min(ans, tmp);
        // if (ans == 150)
        // {
        //     cout << 1 << endl;
        // }

        tmp = abs(x[i] - s[itr1 - s.begin()]) + abs(s[itr1 - s.begin()] - t[itr2 - t.begin() - 1]);
        ans = min(ans, tmp);
        // if (ans == 150)
        // {
        //     cout << 2 << endl;
        // }

        tmp = abs(x[i] - s[itr1 - s.begin()]) + abs(s[itr1 - s.begin()] - t[itr2 - t.begin()]);
        ans = min(ans, tmp);
        // if (ans == 150)
        // {
        //     cout << 3 << endl;
        // }

        tmp = abs(x[i] - t[itr2 - t.begin() - 1]) + abs(t[itr2 - t.begin() - 1] - s[itr1 - s.begin() - 1]);
        ans = min(ans, tmp);
        // if (ans == 150)
        // {
        //     cout << 4 << endl;
        // }

        tmp = abs(x[i] - t[itr2 - t.begin() - 1]) + abs(t[itr2 - t.begin() - 1] - s[itr1 - s.begin()]);
        ans = min(ans, tmp);
        // if (ans == 150)
        // {
        //     cout << 5 << endl;
        // }

        tmp = abs(x[i] - t[itr2 - t.begin()]) + abs(t[itr2 - t.begin()] - s[itr1 - s.begin() - 1]);
        ans = min(ans, tmp);
        // if (ans == 150)
        // {
        //     cout << 6 << endl;
        // }

        tmp = abs(x[i] - t[itr2 - t.begin()]) + abs(t[itr2 - t.begin()] - s[itr1 - s.begin()]);
        ans = min(ans, tmp);
        // if (ans == 150)
        // {
        //     cout << 7 << endl;
        // }

        cout << ans << endl;
    }

    return 0;
}


Measured memory_bytes: 3712
package main

import (
	"bufio"
	"fmt"
	"os"
	"strings"
)

func main() {
	var str string
	s := wordScanner(1000001)
	scanStrings(s, &str)

	sample := strings.Repeat("10", 50001)

	fmt.Println(min(sub(str, sample), sub(str, sample[1:])))
}

func sub(s, t string) int {
	c := 0
	for i := range s {
		if s[i] != t[i] {
			c++
		}
	}
	return c
}

func wordScanner(n int) *bufio.Scanner {
	s := bufio.NewScanner(os.Stdin)
	s.Split(bufio.ScanWords)
	buf := make([]byte, n)
	s.Buffer(buf, n)
	return s
}

func scanStrings(s *bufio.Scanner, vals ...*string) {
	for i := range vals {
		s.Scan()
		*vals[i] = s.Text()
	}
}

func min(x, y int) int {
	if x < y {
		return x
	}
	return y
}


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

int main() {
  int64_t a, b, c, d;
  cin >> a >> b >> c >>d;
  if(a>0&&c>0)cout << b*d << endl;
  else if(a>=0&&d<=0)cout << a*d << endl;
  else if(b<=0&&c>=0)cout << c*b << endl;
  else if(b<=0&&d<=0)cout << a*c << endl;
  else if(a*b<0||c*d<0)cout << max(a*c, b*d) << endl;
}

Measured memory_bytes: 3592
// #pragma GCC optimize("Ofast")
// #pragma GCC optimize ("unroll-loops")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

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

typedef long long int ll;
#define endl '\n'
#define ld long double
#define all(a) a.begin(),a.end()
#define int long long
#define pb push_back
#define pii pair <int, int>
#define ff first
#define ss second
#define sz(v) (int)v.size() 
#define UB upper_bound
#define LB lower_bound
#define BP(x) __builtin_popcountll(x)
#define OST tree<pii, null_type,less<pii>, rb_tree_tag,tree_order_statistics_node_update>
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int getRand(int l, int r) {
  uniform_int_distribution<int> uid(l, r);
  return uid(rng);
}

const int INF = 1e18 + 0;
const int mod = 1e9 + 7;
//const int mod = 998244353;
const int L = 62;

int basis[L], bsize;

void prepare(int mask) {
  for(int i = 0; i < L; i++) {
    if((mask&(1ll<<i))) {
      if(!basis[i]) {
        basis[i] = mask; bsize++;
        return;
      }
      mask ^= basis[i];
    }
  }
}

bool ok(int mask) {
  for(int i = 0; i < L; i++) {
    if((mask&(1ll<<i))) {
      if(!basis[i]) {
        return 0;
      }
      mask ^= basis[i];
    }
  }
  return 1;
}

void solve() {
    memset(basis,0, sizeof(basis));
    int n; cin >> n;
    int data[n+5];
    for(int i = 1; i <= n; i++) {
      cin >> data[i];
    }
    string s; cin >> s;
    reverse(all(s));
    reverse(data+1, data+n+1);
    for(int i = 0; i < sz(s); i++) {
      if(s[i] == '0') {
        prepare(data[i+1]);
      } else {
        if(!ok(data[i+1])) {
          cout << "1\n"; return;
        }
      }
    }
    cout << "0\n";
}

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

  #ifndef ONLINE_JUDGE
   freopen("input.txt", "r", stdin);
   freopen("output.txt", "w", stdout);
  #endif
   int t = 1;  cin >> t;
   for(int i = 1; i <= t; i++) {
     solve();
  }
}    


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

using namespace std;
bool comp(int a, int b){
	return a > b;
}
int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	
	float a, b;
	cin >> a >> b;
	cout << floor(float(((a*3) + b)/2));
}

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

using namespace std;

typedef long long ll;

double getTime() {
  return clock() / (double) CLOCKS_PER_SEC;
}

void read() {};

template<typename T, typename... Args>
void read(T& a, Args&... args) {
  cin >> a;
  read(args...);
}

void print() {};

template <typename T, typename... Args>
void print(T a, Args... args) {
  cout << a << " \n"[sizeof...(args) == 0];
  print(args...);
}

const int N = 5e5 + 5;

int fen[26][N];
int n;

int upd(int id, int idx, int val) {
  while(idx <= n) {
    fen[id][idx] += val;
    idx += (idx) & (-idx);
  }
}

int query(int id, int idx) {
  int ans = 0;
  while(idx > 0) {
    ans += fen[id][idx];
    idx -= (idx) & (-idx);
  }
  return ans;
}

int get(int id, int L, int R) {
  return (query(id, R) - query(id, L - 1)) > 0;
}

int main() {
  scanf("%d", &n);
  string s; cin >> s;
  for(int i = 0; i < n; i++) {
    upd(s[i] - 'a', i + 1, +1);
  }
  int q; scanf("%d", &q);
  while(q--) {
    int id; scanf("%d", &id);
    if(id == 1) {
      int idx; scanf("%d", &idx);
      idx--;
      string x; cin >> x;
      upd(s[idx] - 'a', idx + 1, -1);
      s[idx] = x[0];
      upd(s[idx] - 'a', idx + 1, +1);
    }
    else {
      int l, r; scanf("%d %d", &l, &r);
      int ans = 0;
      for(int k = 0; k < 26; k++) {
        ans += get(k, l, r);
      }
      printf("%d\n", ans);
    }
  }
}

Measured memory_bytes: 51716
#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <array>
#include <vector>
#include <functional>
#include <unordered_map> 
#include <map> 
#include <numeric>
#include <limits>
#include <utility>
#include <queue>
#include <random>
#include <bitset>
#include <memory>
using namespace std;
typedef long long LL;

int main() {
    int h, w;
    cin >> h >> w;
    vector<string> a(h);
    vector<string> ans;
    
    bool t = true;

    for (int i = 0; i < h; i++) {
        cin >> a[i];
    }
    string s = "";
    for (int i = 0; i < w; i++) {
        s += ".";
    }
    /*for (int i = 0; i < a.size(); i++) {
        if (a[i] == s) {
            a.erase(a.begin() + i);
            i = 0;
        }
    }*/

    for (int i = 0; i < h; i++) {
        if (a[i] == s) {
            continue;
        }
        ans.push_back(a[i]);
    }
    string ss = "";
    vector<string> ans2(ans.size(), "");
    for (int i = 0; i < ans.size(); i++) {
        ss += '.';
    }

    for (int i = 0; i < ans[0].size(); i++) {
        string e = "";
        for (int j = 0; j < ans.size(); j++) {
            e += ans[j][i];
        }
        if (e != ss) {
            for (int k = 0; k < ans.size(); k++) {
                ans2[k] += e[k];
            }
        }
    }

    for (int i = 0; i < ans.size(); i++) {
        cout << ans2[i] << endl;
    }

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define fi first
#define se second
#define pb push_back
using namespace std;

ll n,a,b;

int main()
{

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

    cin >> n >> a >> b;
    cout << min( n*a , b );

    return 0;
}


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

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

int main(void) {
    int n, ans = 0;

    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> n;
    vector<int> p(n);
    REP(i, n) {
        cin >> p[i];
    }
    REP(i, n - 2) {
        if (p[i] < p[i + 1] && p[i + 1] < p[i + 2]) {
            ans++;
        }
        if (p[i] > p[i + 1] && p[i + 1] > p[i + 2]) {
            ans++;
        }
    }

    cout << ans << "\n";
    return 0;
}

Measured memory_bytes: 256
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<iostream>
#include<string>
#include<vector>
#include<stack>
#include<bitset>
#include<cstdlib>
#include<cmath>
#include<set>
#include<list>
#include<deque>
#include<map>
#include<queue>
using namespace std;
typedef long long ll;
const double PI = acos(-1.0);
const double eps = 1e-6;
const int mod = 1e9+7;
const int maxn = 200005;
int T,n,m;
int main() {
//    scanf("%d",&T);
//    while(T--) {
//
//    }
	ll nn,a,b,c,d;
	cin>>nn>>a>>b>>c>>d;
	string s;
	cin>>s;
	//int flag = 0;
	if(c>d){
		int flag = 0;
		for(int i=b-2;i<d-1;i++)
			if(s[i]=='.'&&s[i+1]=='.'&&s[i+2]=='.'){
				flag = 1;
				//cout<<1111<<endl;
				break;
			}
		if(!flag){
			cout<<"No\n";
			return 0;
		}		
	}
		
	for(int i=min(a,b);i<max(c,d);i++){
		if(s[i]=='#'&&s[i+1]=='#'){
			cout<<"No\n";
			return 0;
		}
	}
	cout<<"Yes\n";
    return 0;
}

Measured memory_bytes: 640
n,k=map(int,input().split())
List=list(map(int,input().split()))


li = []

for i in range(n):
    count=0
    for j in range(n):
        if List[i]>List[j]:
            count += 1
    li.append(count)

count2=0

for i in range(1,n):
    for j in range(i+1,n+1):
        if int(List[i-1]) > int(List[j-1]):
            count2 += 1

counted = k*count2 + (sum(li))*k*(k-1)//2

ans = counted % (10**9+7)
print(int(ans))

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

int main() {
  string s;
  cin >> s;
  
  bool seven = false;
  for (int i = 0; i < 3; i++) {
    if (s.at(i) == '7')
      seven = true;
  }
  
  if (seven)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  
  return 0;
}

Measured memory_bytes: 3628
#include <iostream>
#include <vector>
#include <array>
#include <algorithm>
#include <string>
#include <numeric>
using namespace std;

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

    vector<int> m;
    for(int i = 0; i < N; i++) {
        int tmp;
        cin >> tmp;
        m.push_back(tmp);
    }

    int result = N;
    X -= accumulate(m.begin(), m.end(), 0);

    result += X / *min_element(m.begin(), m.end());

    cout << result << endl;
    return 0;
}


Measured memory_bytes: 256
#include <limits.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <math.h>

#define P 1000000007

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

int main(void){
	int n, i;
	int h[100000];
	scanf("%d", &n);
	for(i=0; i<n; i++){
		scanf("%d", h+i);
	}
	int now=h[n-1];
	for(i=n-2; i>=0; i--){
		if(h[i]>now+1){
			puts("No");
			return EXIT_SUCCESS;
		}else if(h[i]<now+1){
			now=h[i];
		}
	}
	puts("Yes");
}


Measured memory_bytes: 512
#include<iostream>
using namespace std;
int main(){
    string s1,s2,s3;
	cin>>s1>>s2>>s3;
	int l1=s1.size();
		
		int l2=s2.size();
			int l3=s3.size();
			int c1=0,c2=0,c3=0;
			char x=s1[c1++];
			while(1){
				if(x=='a'){
				if(c1<l1)
				x=s1[c1++];
				else{
					cout<<"A"<<endl;
					return 0;
				}
			}else if(x=='b'){
			    if(c2<l2)
				x=s2[c2++];
				else{
					cout<<"B"<<endl;
					return 0;
				}
			}else if(x=='c'){
					if(c3<l3)
				x=s3[c3++];
				else{
					cout<<"C"<<endl;
					return 0;
				}
				
			}
			
				
				
			}
		
}

Measured memory_bytes: 256
n,m=map(int,input().split())
k=[list(map(int,input().split())) for _ in range(m)]
k2=[]
for v in k:
  a=[2**(v[i]-1) for i in range(1,v[0]+1)]
  k2.append(sum(a))
  
p=list(map(int,input().split()))

sm=0
for i in range(2**n):
  c=1
  for j in range(m):
    b=bin(k2[j] &i)
    
    d=b.count("1")
    if d%2!=p[j]:
      c=0
  if c==1:
    sm+=1

print(sm)

Measured memory_bytes: 9120
import java.util.*;

public class Main {

	static int startX, startY;
	static int[] moveX = {0,0,-1,1};
	static int[] moveY = {-1,1,0,0};
	static int w, h;
	static int maxMove = 10;
	static int ans;

	public static void finish (int move) {
		if (ans == -1) {
			ans = move;
		} else {
			ans = Math.min(move, ans);
		}
	}

	public static boolean ok (int y, int x) {
		return 0 <= y && y < h && 0 <= x && x < w;
	}

	public static void show (int[][] field) {

		for (int i = 0; i < field.length; i++) {
			for (int j = 0; j < field[i].length; j++) {
				System.out.printf("%2d ", field[i][j]);
			}
			System.out.println();
		}
		System.out.println();

	}

	public static void dfs (int y, int x, int move, int[][] field) {
//		System.out.println(y + "," + x + "   : " + move);
//		show(field);

		if (move == maxMove) return;

		for (int i = 0; i < moveX.length; i++) {

			if (ok(y + moveY[i],x + moveX[i]) &&
				field[y + moveY[i]][x + moveX[i]] != 1) {
				
				int nextY = y, nextX = x;

				while (ok(nextY + moveY[i],nextX + moveX[i])) {
					if (field[nextY + moveY[i]][nextX + moveX[i]] == 1) break;
					nextY += moveY[i];
					nextX += moveX[i];
					if (field[nextY][nextX] == 3) {
						finish(move + 1);
						return;
					}
				}

				boolean flag = false;

				if (ok(nextY + moveY[i],nextX + moveX[i])) {
					field[nextY + moveY[i]][nextX + moveX[i]] = 0;
					flag = true;
				} else {
					continue;
				}

				dfs(nextY,nextX,move + 1,field);

				if (flag) {
					field[nextY + moveY[i]][nextX + moveX[i]] = 1;
				}

			}

		}

	}

	public static void main(String[] args) {

		int[][] field;
		Scanner sc = new Scanner(System.in);

		while (true) {

			w = sc.nextInt();
			h = sc.nextInt();
			if (w == 0 && h == 0) break;
			ans = -1;
			field = new int[h][w];
			for (int i = 0; i < h; i++) {
				for (int j = 0; j < w; j++) {
					field[i][j] = sc.nextInt();
					if (field[i][j] == 2) {
						startX = j;
						startY = i;
					}
				}
			}
			dfs(startY, startX, 0, field);
			System.out.println(ans);
		}

	}

}

Measured memory_bytes: 13000
#include<bits/stdc++.h>
using namespace std;
 
int main(){
    ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
 
    int x;
    cin>>x;
    for(int i=x;;i++){
        bool f=1;
        for(int j=2;j<i;j++)
            if(i%j==0){
                f=0;
                break;
            }
        if(f){
            cout<<i;
            break;
        }
    }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 int PS(int m) {
   int count=0;
   int counting=0;
   for (int i=2;i<m;i++) {
      if ((m%i) !=0) {
      count++;
    }
    else if ((m%i) ==0) {
   counting++;
      
   }
  }
   if (count==m-2) {
     return m;
   }
   else {
     return m+1;
   }
 }
int main() {
 int x;
  cin >>x;
  if (x !=2) {
  for(int i=1;i<x; i++) {
    if (PS(x) ==x) {
      cout << x << endl;
      break;
    }
    else if (PS(x)-1 ==x) {
      x++;
    }
  }
  
  }
else if (x==2) {
  cout << 2 << endl;
}


}   
      
  
  
 
  

Measured memory_bytes: 256
a,b=map(int,input().split())
if (a>0 and b>0):
    print("Positive")
elif a==0 or b==0 or a==b:
    print("Zero")
elif a<0 and b<0:
    tmp=abs(a)-abs(b)+1
    if tmp%2==0:
        print("Positive")
    else:
        print("Negative")
else:
    print("Zero")


Measured memory_bytes: 2940
class Integer
  def factorial
    1.upto(self).inject(:*) || 0
  end
end

def position(s, numbers = [*1..s.size], result = 1)
  return result if s.empty?

  result += numbers.rindex(s[0]) * (numbers.size - 1).factorial
  numbers.delete(s[0])
  position(s[1..-1], numbers, result)
end

n = gets.to_i
p = gets.split.map(&:to_i)
q = gets.split.map(&:to_i)

a = position(p)
b = position(q)

puts (a - b).abs


Measured memory_bytes: 1788
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <utility>
using namespace std;

typedef pair<int, int> pii;
const int MAX_M = 1000000;
const int dx[] = {0, -1, 0, 1};
const int dy[] = {1, 0, -1, 0};
const int ex[] = {1, 1, 1};
const int ey[] = {-1, 0, 1};
const int S = 510;
 
int board[2*S][2*S];
pii rec[2*S][2*S];
int posX[MAX_M + 1], posY[MAX_M + 1], isprime[MAX_M + 1];

void init_board() {
    int lim[] = {1, 1, 2, 2};
    int cur = 1, x = S, y = S;

    memset(board, -1, sizeof(board));
    while(cur <= MAX_M) {
        for(int k=0; k<4; k++) {
            for(int t=0; t<lim[k]; t++) {
                if(cur > MAX_M) return;
                posX[cur] = x, posY[cur] = y;
                board[x][y] = cur++;
                x += dx[k], y += dy[k];
            }
            lim[k] += 2;
        }
    }
}

void init_prime() {
    fill(isprime, isprime + MAX_M + 1, true);
    isprime[0] = isprime[1] = false;
    for(int i=2; i<=MAX_M; i++) {
        if(isprime[i]) {
            for(int k=2*i; k<=MAX_M; k+=i) {
                isprime[k] = false;
            }
        }
    }
}

int main() {
    init_board();
    init_prime();
    while(1) {
        int M, N; scanf("%d%d", &M, &N);
        if(M == 0) break;

        pii INIT = make_pair(-1, -1);
        for(int x=0; x<2*S; x++) {
            fill(rec[x], rec[x] + 2*S, INIT);
        }
        pii ans = rec[posX[N]][posY[N]] = make_pair(isprime[N], isprime[N] ? N : 0);
        for(int x=posX[N]; x<2*S; x++) {
            for(int y=0; y<2*S; y++) {
                int cur = board[x][y];
                if(cur < 0 || cur > M || rec[x][y] == INIT) continue;
                for(int k=0; k<3; k++) {
                    int nx = x + ex[k], ny = y + ey[k];
                    if(nx < 0 || nx >= 2*S || ny < 0 || ny >= 2*S) continue;
                    int val = board[nx][ny];
                    if(val < 0 || val > M) continue;
                    int ncost = rec[x][y].first + isprime[val];
                    int nprev = (isprime[val] ? val : rec[x][y].second);
                    if(rec[nx][ny].first < ncost) {
                        // printf("rec[%d][%d] = (%d, %d)\n", nx, ny, ncost, nprev);
                        rec[nx][ny] = make_pair(ncost, nprev);
                        ans = max(ans, rec[nx][ny]);
                    }
                }
            }
        }
        printf("%d %d\n", ans.first, ans.second);
    }
    return 0;
}


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

using namespace std;

typedef long long ll;

/// The definitions in this library are as below.
#define rI readInt
#define rL readLong
#define rC readChar
#define rC2 readChar2
#define rS readString

#define pb push_back

#define acc accumulate

#define FOR(i, a, b) for(int i=(a); i<=(b); i++)
#define FOR0(i, a, b) for(int i=(a); i<(b); i++)
namespace __library_79brue{
    /// This is a C++ library which improves the programming speed by \
        defining frequently used data structures or algorithms.       \
        This library can be freely used without any copyrights,       \
        but I recommend not to change the name of this library.       \
        Made by 79brue                                                \
        2019

    /// The functions or structures in this library are as below.
    /// quit()
    /// readInt() readLong() readChar() readChar2() readString()

    /// terminates the program
    inline void quit(){
        exit(0);
    }

    /// reads an integer
    inline void readInt(int& _x){
        scanf("%d", &_x);
    }

    /// reads a long-long integer
    inline void readLong(ll& _x){
        scanf("%lld", &_x);
    }

    /// reads a character
    inline void readChar(char& _x){
        scanf(" %c", &_x);
    }

    /// reads a character, the character may be space or line-break, etc...
    inline void readChar2(char &_x){
        scanf("%c", &_x);
    }

    inline void readString(char* _x){
        scanf("%s", _x);
    }

    inline int readLine(char* _x, int limit){
        if(!fgets(_x, limit, stdin)) quit();
        int _y = strlen(_x);
        while(_x[_y-1] == '\n' or _x[_y-1] == '\r') _y--;
        return _y;
    }
}
using namespace __library_79brue;

int a, b;

int main(){
    rI(a), rI(b);
    printf("%d", max(0, a-2*b));
}


Measured memory_bytes: 256
#include<stdio.h>
 
int main(void) {
  int i=1;
  int n,x,y;
  scanf("%d",&n);
  do{
    x=i;
    y=x;
    if(x%3==0)
      printf(" %d",y);
    else
      do{
    if(x%10==3){
      printf(" %d",y);
      break;
    }
      }while(x/=10);
  }while(++i<=n);
  printf("\n");
  return(0);
}


Measured memory_bytes: 2104
#include <algorithm>
#include <bitset>
#include <tuple>
#include <cstdint>
#include <cstdio>
#include <cctype>
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <limits>
#include <map>
#include <memory>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
using namespace std;
//#define int long long  ←保留
#define _CRT_SECURE_NO_WARNINGS
#define rep(i, n) for (int i = 0; i < n; i++)
#define _GLIBCXX_DEBUG
const int MOD = 1e9 + 7;
const int INF = 1e18 + 9;
constexpr long double pi = 3.141592653589793238462643383279; //円周率
/*---------------------便利な関数--------------------------------------*/
int fact(int i) {       //階乗
    if (i == 0) return 1;
    return (fact(i - 1)) * i;
}

int gcd(int a, int b) {        //最大公約数
    if (b == 0) return a;
    return gcd(b, a % b);
}

int lcm(int a, int b) {      //最小公倍数
    return a * b / gcd(a, b);
}

int keta(int n) {        //桁数を求める
    if (n == 0) return 1;
    int count = 0;
    while (n != 0) {
        n /= 10;
        count++;
    }
    return count;
}

int ketasum(int n) {    //各桁の和
    int sum = 0;
    while (n != 0) {
        sum += n % 10;
        n /= 10;
    }
    return sum;
}
/*-------------ここまで---------------------------------------------*/

//C++(GCC9.2.1)

/*signed*/int main() {
    int N; cin >> N;
    vector<int>W(N);
    vector<int>sum(N);
    int ans = 0;
    rep(i, N) {
        cin >> W[i];
        ans += W[i];
        sum[i] = ans;
    }
    int answer = abs(ans - sum[0] * 2);
    rep(i, N)answer = min(answer, abs(ans - sum[i] * 2));
    cout << answer << endl;
    return 0;
}

Measured memory_bytes: 3608
#include<iostream>
#include<fstream>
#include<algorithm>
using namespace std;
int a,b;
int main()
{
	cin>>a>>b;
	if((a+b)%2==0)
	{
		cout<<(a+b)/2<<endl;
		return 0;
	}
	if((a+b)%2!=0)
	{
		cout<<(a+b)/2+1<<endl;
		return 0;
	}
    return 0;
}

Measured memory_bytes: 256
use std::io;
use std::str::FromStr;

fn input<T:FromStr>() -> T {
    let mut line: String = String::new();
    io::stdin().read_line(&mut line);
    line.trim().parse().ok().unwrap()
}

fn input_i32_vec() -> Vec<i32> {
    let mut line: String = String::new();
    io::stdin().read_line(&mut line);
    line.split_whitespace().map(|s| s.parse().unwrap()).collect()
}

fn main() {
    let n: usize = input();
    let mut d_vec = input_i32_vec();
    d_vec.sort();
    println!("{}", d_vec[n/2] - d_vec[n/2-1]);
}


Measured memory_bytes: 4352
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.InputMismatchException;
import java.util.Map;
import java.util.Set;
import java.util.StringTokenizer;
import java.util.TreeMap;

public class Main {

	public static void main(String[] args) throws IOException {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskX solver = new TaskX();
		solver.solve(1, in, out);
		out.close();
	}

	static class TaskX {
		public void solve(int testNumber, InputReader in, PrintWriter out) {

			int n = in.nextInt();
			Set<String> s = new HashSet<>();
			for (int i = 0; i < n; i++) {
				s.add(in.nextString());
			}
			if (s.size() == 3) {
				System.out.println("Three");
			} else if (s.size() == 4) {
				System.out.println("Four");
			}
		}
	}

	static class ArrayUtils {
		public static Map<Integer, Integer> getCountMap(int[] array) {
			Map<Integer, Integer> map = new TreeMap<>();
			for (int x : array)
				map.merge(x, 1, Integer::sum);
			return map;
		}
	}

	static class InputReader {
		BufferedReader in;
		StringTokenizer tok;

		public String nextString() {
			while (!tok.hasMoreTokens()) {
				try {
					tok = new StringTokenizer(in.readLine(), " ");
				} catch (IOException e) {
					throw new InputMismatchException();
				}
			}
			return tok.nextToken();
		}

		public int nextInt() {
			return Integer.parseInt(nextString());
		}

		public long nextLong() {
			return Long.parseLong(nextString());
		}

		public int[] nextIntArray(int n) {
			int[] res = new int[n];
			for (int i = 0; i < n; i++) {
				res[i] = nextInt();
			}
			return res;
		}

		public long[] nextLongArray(int n) {
			long[] res = new long[n];
			for (int i = 0; i < n; i++) {
				res[i] = nextLong();
			}
			return res;
		}

		public InputReader(InputStream inputStream) {
			in = new BufferedReader(new InputStreamReader(inputStream));
			tok = new StringTokenizer("");
		}

	}

}


Measured memory_bytes: 21204
#include<bits/stdc++.h>
#define ll long long int
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
static const ll MAX = 1000000000000000;
static const int NIL = -1;
using namespace std;
const long double EPS = 0.0000000001;
const long double PI = (acos(-1));
const ll MOD = 1e9 + 7;

#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")

int main() {
    int n,k,count = 0,sum = 0, ans = -1; cin >> n >> k;
    string s; cin >> s;
    vector<int> l,r;
    s += 'a';

    rep(i,n){
        if(s[i] == '1') count ++;
        else{
            if(l.size() != 0)r.push_back(l[l.size()-1]+count);
            while(s[i+1] == '0'){
                count ++;
                i ++;
            }
            l.push_back(count+1);
            count = 0;
        }
    }
    if(count == n){
        cout << n;
        return 0;
    }
    r.push_back(l[l.size()-1]+count);

    /*
    rep(i,l.size()) cout << l[i] << " " ;
    cout << endl;
    rep(i,r.size()) cout << r[i] << " ";
    cout << endl;
    */
    if(r.size() == 0 || r.size() <= k) {
        cout << n;
        return 0;
    }

    for(int i = r.size()-1; i >= k-1; i --){
        sum = 0;
        rep(j,k) {
            if(j == 0) sum += r[i];
            else sum += l[i-j];
        }
        ans = max(ans,sum);
    }
    cout << ans;

}


Measured memory_bytes: 3956
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
#pragma GCC target ("avx2,tune=native")
#include<bits/stdc++.h>
// #include<ext/pb_ds/tree_policy.hpp>
// #include<ext/pb_ds/assoc_container.hpp>
#define pb push_back
#define __V vector
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define oit ostream_iterator
#define mod 1000000007ll
using namespace std;
void doin() {
	cin.tie();
	cout.tie();
	ios::sync_with_stdio(0);
#ifndef ONLINE_JUDGE
//	freopen("input.txt", "r", stdin);
//	freopen("output.txt", "w", stdout);
#endif
}
template<typename X, typename Y>
istream& operator>>(istream& in, pair<X, Y> &a) {
	in >> a.first >> a.second;
	return in;
}
template<typename T>
void getv(T& i) {
	cin >> i;
}
template<typename T, typename ... Ns>
void getv(vector<T>& v, int n, Ns ... ns) {
	v.resize(n);
	for (auto& i : v)
		getv(i, ns...);
}
template<typename T>
void getv1(T& i) {
	cin >> i;
}
template<typename T, typename ... Ns>
void getv1(vector<T>& v, int n, Ns ... ns) {
	v.resize(n + 1);
	for (int i = 1; i <= n; i++)
		getv1(v[i], ns...);
}
#ifdef _WIN32
#define getchar_unlocked() _getchar_nolock()
#define _CRT_DISABLE_PERFCRIT_LOCKS
#endif
inline void getch(char &x) {
	while (x = getchar_unlocked(), x < 33) {
		;
	}
}
inline void getstr(string &str) {
	str.clear();
	char cur;
	while (cur = getchar_unlocked(), cur < 33) {
		;
	}
	while (cur > 32) {
		str += cur;
		cur = getchar_unlocked();
	}
}
template<typename T> inline bool sc(T &num) {
	bool neg = 0;
	int c;
	num = 0;
	while (c = getchar_unlocked(), c < 33) {
		if (c == EOF)
			return false;
	}
	if (c == '-') {
		neg = 1;
		c = getchar_unlocked();
	}
	for (; c > 47; c = getchar_unlocked())
		num = num * 10 + c - 48;
	if (neg)
		num *= -1;
	return true;
}
template<typename a, typename b>
void minq(a& x, b y) {
	if (x > y)
		x = y;
}
template<typename a, typename b>
void maxq(a& x, b y) {
	if (x < y)
		x = y;
}
typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;
typedef ll _I;
typedef pair<_I, _I> pi;
typedef pair<ld, ld> pd;
typedef map<_I, _I> mii;
typedef __V <_I> vi;
typedef __V <char> vc;
typedef __V <string> vs;
typedef __V <ld> vd;
typedef __V <vd> vvd;
typedef __V <pi> vpi;
typedef __V <__V<_I>> vvi;
typedef __V <__V<char>> vvc;
typedef __V <__V<pi>> vvpi;
using AntonTsypko = void;
using arsijo = AntonTsypko;
using god = arsijo;
//store differences, not the elements for rsq in fenwick or array(for write-only)
//SQRT-heuristic divide items into groups: >sqrt and <=sqrt and do something according to group(eg. trie for one, z-func for other) - 1202E
uniform_real_distribution<double> double_dist(0, 1);
//WHEN DOING MODULAR SUBTRACTION ALWAYS **ALWAYS** ADD MOD
//don't use AVX at AtCoder
//Trie: MAXDEPTH!=MAXSIZE
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

int main() {
	doin();
	ll n;
	cin >> n;
	vd a;
	getv(a, n);
	sort(all(a));
	ld ans = a[0];
	for(int i =1;i < n; i++)
		ans = (ans+a[i])/2.0;
	cout << fixed << setprecision(15) << ans;
}


Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main(){
int a,b;
char c;
for(int i=0;;i++){
cin>>a>>c>>b;
if(c=='+')
cout<<a+b<<endl;
if(c=='-')
cout<<a-b<<endl;
if(c=='*')
cout<<a*b<<endl;
if(c=='/')
cout<<a/b<<endl;
if(c=='?'){
return 0;}}
return 0;
}

Measured memory_bytes: 3108
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <ctime>
#include <cstring>
#include <functional>
#include <iostream>
#include <iomanip>
#include <limits>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <regex>
#include <vector>

#define fix(n)          cout<<fixed<<setprecision(n)
#define rep(i,n)        for (int i = 0; i < (n); ++i)
#define sort(a)         sort((a).begin(), (a).end())
#define uniq(a)         SORT(a);(a).erase(unique((a).begin(), (a).end()), (a).end())
#define reverse(a)      reverse((a).begin(), (a).end())
#define ctos(c)         string(1, (c))
#define out(d)          cout << (d)
#define outl(d)         std::cout<<(d)<<"\n"
#define YES()           cout << "YES" << endl
#define NO()            cout << "NO" << endl
#define Yes()           cout << "Yes" << endl
#define No()            cout << "No" << endl
#define ceil(x, y)      ((x + y - 1) / (y))
#define debug(x)        cerr << #x << ": " << (x) << '\n'
#define debug2(x, y)    cerr << #x << ": " << (x) << ", " << #y << ": " << (y) << '\n'
#define debug3(x, y, z) cerr << #x << ": " << (x) << ", " << #y << ": " << (y) << ", " << #z << ": " << (z) << '\n'
#define dbg(v)          for (size_t _ = 0; _ < v.size(); ++_){ cerr << #v << "[" << _ << "] : " << v[_] << '\n'; }

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

const ll MOD = 1000000007; // 10^9 + 7

void solve() {
  ll n; cin >> n;
  ll l[90] = {0};
  l[0] = 2; l[1] = 1;
  for (int i = 2; i <= n; i++)
    l[i] = l[i-1] + l[i-2];
  outl(l[n]);
}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  srand((unsigned)time(NULL));
  fix(12);

  solve();
}


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

const int cm = 1 << 17;
char cn[cm], * ci = cn + cm, ct;
inline char getcha() {
  if (ci - cn == cm) { fread_unlocked(cn, 1, cm, stdin); ci = cn; }
  return *ci++;
}

inline int getint() {
  int A = 0;
  if (ci - cn + 16 > cm) while ((ct = getcha()) >= '0') A = A * 10 + ct - '0';
  else while ((ct = *ci++) >= '0') A = A * 10 + ct - '0';
  return A;
}

const int dm = 1 << 20;
char dn[dm], * di = dn;

inline void putint(int X) {
  if (X == 0) {
    *di++ = '0';
    *di++ = '\n';
    return;
  }
  int keta = 0;
  char C[10];
  while (X) {
    *(C + keta) = '0' + X % 10;
    X /= 10;
    keta++;
  }
  for (int i = keta - 1; i >= 0; i--)* di++ = (*(C + i));
  *di++ = '\n';
}

int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  int n = getint(), q = getint();
  vector<int> arr(n);
  arr[0] = 0;
  for (int i = 0; i < n - 1; ++i) {
    arr[i + 1] = arr[i];
    if (*ci++ == 'A' && *ci =='C') ++arr[i + 1];
  }
  ci += 2;
  for (int i = 0; i < q; ++i) {
    int left = getint(), right = getint();
    putint(arr[right - 1] - arr[left - 1]);
  }
  fwrite_unlocked(dn, di - dn, 1, stdout);
}


Measured memory_bytes: 1920
#include <bits/stdc++.h>
using namespace std;
const int maxn = 555;
int c[maxn][maxn];
int main(){
	int n, m; cin >> n >> m;
	for(int i = 0; i < n; i++){
		for(int j = 0; j < m; j++){
			char v; cin >> v;
			if(v == '#') c[i][j] = 3;
		}
	}
	for(int i = 0; i < n; i++){
		c[i][0] |= 1;
		if(i&1){
			for(int j = 0; j < m - 1; j++) c[i][j] |= 1;
		}
	}
	for(int i = 0; i < n; i++){
		c[i][m - 1] |= 2;
		if((~i)&1){
			for(int j = 1; j < m; j++) c[i][j] |= 2;
		}
	}
	for(int i = 0; i < n; cout << endl, i++) for(int j = 0; j < m; j++){
		if(c[i][j]&1) cout << '#';
		else cout << '.';
	}
	cout << endl;
	for(int i = 0; i < n; cout << endl, i++) for(int j = 0; j < m; j++){
		if(c[i][j]&2) cout << '#';
		else cout << '.';
	}
	return 0;
}


Measured memory_bytes: 1792
#include<iostream>
#include<algorithm>
#include<cmath>
#include<map>
#include<numeric>
#include<set>
#include<string>
#include<utility>
#include<vector>

#define rep(i, a, n)  for(int i=a; i<n; i++)
#define per(i, a, n)  for(int i=n-1; i>=a; i--)
#define all(x)  (x).begin(), (x).end()
#define MAX 10000
using namespace std;

int main(){
  int n;  cin >> n;
  int ans=0;
  vector<int> vec(100001, 0);
  rep(i, 0, n){
    int tmp;
    cin >> tmp;
    vec[tmp]++;
  }
  rep(i, 1, 100001){
    ans = max(ans, vec[i]+vec[i-1]+vec[i+1]);
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 640
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int odd = 0;

		for (int i = 1; i <= N; i++) {
			String tmp = String.valueOf(i);
			if (tmp.length() % 2 != 0) {
				odd++;
			}
		}
		System.out.println(odd);
		sc.close();
	}
}

Measured memory_bytes: 30420
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
 
int num,stack[200];


int pop(){
  num--;
  return stack[num+1];
}


void push(int n){
  stack[++num] = n;
}


int main(void){
  int a,b;
  num = 0;
  char c[100];
  while(scanf("%s",c)!=EOF){
    if( c[0] == '+' ){
      a = pop();
      b = pop();
      push( a + b );
    }
    else if( c[0] == '-' ){
      b = pop();
      a = pop(); 
      push( a - b);
    }
    else if( c[0] == '*' ){
      a = pop();
      b = pop();
      push( a * b );
    }
    else{
      push(atoi(c));  //文字列の数値をint型の数値に変換する
    }
  }
  printf("%d\n",pop());
  return 0;
}

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

int main() {
  int N;
  cin >> N;
  vector<int>data(N);
  for(int i;i<N;i++){
    char a;
    cin >> a;
    if(a=='W') data.at(i)=0;
    else data.at(i)=1;
  }
  vector<int>r(N);
  int one=0;
  for(int i=1;i<N;i++){
    one+=data.at(i);
  }
  r.at(0)=one;
  for(int i=1;i<N;i++){
    int a=0;
    if(data.at(i)==1) a--;
    if(data.at(i-1)==0) a++;
    r.at(i)=r.at(i-1)+a;
  }
  sort(r.begin(),r.end());
  
  cout << r.at(0) << endl;
}

Measured memory_bytes: 5572
#include <stdio.h>
#include <cmath>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>

using namespace std;

#define NUM 7370000

int main(){
	int limit;
	int* table = new int[NUM];
	int* work = new int[NUM];

	for(int i=0; i < NUM;i++)table[i] = 1;
	table[0] = 0;
	table[1] = 0;

	limit = sqrt(NUM);

	for(int i=2;i<=limit;i++){
		if(table[i] == 1){
			for(int k=2*i;k < NUM; k += i){
				table[k] = 0;
			}
		}
	}

	int index = 0;
	int* prime_table = new int[550000];

	for(int i = 2; i < NUM; i++){
		if(table[i] == 1){
			prime_table[index++] = i;
		}
	}

	int m,n,count,tmp_index;

	while(true){
		scanf("%d %d",&m,&n);
		if(m == 0 && n == 0)break;

		count = 0;
		for(tmp_index = 0; prime_table[tmp_index] <= m; tmp_index++);

		limit = prime_table[tmp_index+n-1];

		for(int i = m; i <= limit; i++)work[i] = 1;

		count = 0;
		for(int i = m; i <=2*m-1 && count < n; i++){
			work[i] = 0;
			count++;
			for(int k = 2*i; k < limit; k += i)work[k] = 0;
		}

		if(count < n){
			for(int i = 2*m;count < n; i++){
				if(work[i] == 1){
					work[i] = 0;
					count++;
					for(int k = 2*i; k < limit; k += i)work[k] = 0;
				}
			}
		}

		for(int i = m; i <= limit; i++){
			if(work[i] == 1){
				printf("%d\n",i);
				break;
			}
		}
	}
	return 0;
}

Measured memory_bytes: 62260
#include <bits/stdc++.h>
using namespace std;
typedef long long int LL;
//Compiler version g++ 6.3.0
int fact(LL n){
  if(n==1||n==0){
    return 1; 
  }  
  else{
    return fact(n-1)*n;}
}
int main()
{
  LL n, k; 
  cin>>n>>k; 
  LL a[n+1],b[n+1];
  for(LL i=1;i<n+1;i++){
    cin>>a[i];  
  }
  b[0]=1;
  LL j=1;
  for(LL i=1;i<=n;i++){
    b[i]=b[i-1]*a[i];
  }
 // cout<<b[k]<<endl; 
  for(LL i=k+1;i<n+1;i++){
     
 //    cout<<b[i]<<endl; 
     if(a[i]>a[j]){
       cout<<"Yes"<<endl; 
     }
     else{
       cout<<"No"<<endl; 
     }
     j++;
  }
  return 0; 
 }
       


Measured memory_bytes: 6756
#include <iostream>

using namespace std;

int main(){
  int a, b, c, d;
  cin >> a >> b >> c;
  if(a > b){
    d = a;
    a = b;
    b = d;
  }
  if(b > c){
    d = b;
    b = c;
    c = d;
  }
  if(a > b){
    d = a;
    a = b;
    b = d;
  }

  cout << a << " "<< b << " " << c << endl;
}



Measured memory_bytes: 3092