prithivMLmods/Coder-Stat huggingface dataset:
Problem p03544 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <bits/stdc++.h>
using namespace std;

int64_t Luca(int N) {
  if (N == 0)
    return 2;
  else if (N == 1)
    return 1;
  else
    return Luca(N - 1) + Luca(N - 2);
}

int main() {
  int N;
  cin >> N;
  cout << Luca(N) << endl;
}


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

int64_t Luca(int N) {
  if (N == 0)
    return 2;
  else if (N == 1)
    return 1;
  else
    return Luca(N - 1) + Luca(N - 2);
}

int main() {
  int N;
  cin >> N;
  int64_t Luca = 1;
  int64_t count1 = 1;
  if (N == 1)
    cout << Luca << endl;
  else {
    int64_t count2 = 2;
    for (int i = 1; i < N; i++) {
      Luca += count2;
      count2 = count1;
      count1 = Luca;
    }
    cout << Luca << endl;
  }
}
Problem p03544 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define prtd(var, i) cout << fixed << setprecision(i) << var << endl;
#define ll long long
using namespace std;
#define INF 1e18LL

const ll MAX = 1000000000000000000; // 1e18

int main() {
  int n;
  cin >> n;
  vector<ll> ans(n + 2);
  ans[0] = 2;
  ans[1] = 1;
  rep(i, n + 2) { ans[i + 2] = ans[i] + ans[i + 1]; }
  cout << ans[n] << endl;
}


Fixed submission:
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define prtd(var, i) cout << fixed << setprecision(i) << var << endl;
#define ll long long
using namespace std;
#define INF 1e18LL

const ll MAX = 1000000000000000000; // 1e18

int main() {
  int n;
  cin >> n;
  vector<ll> ans(n + 2);
  ans[0] = 2;
  ans[1] = 1;
  for (int i = 2; i < n + 1; i++) {
    ans[i] = ans[i - 1] + ans[i - 2];
  }
  cout << ans[n] << endl;
}
Problem p03544 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

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

  vector<int64_t> L(N);
  L[0] = 2;
  L[1] = 1;

  if (N > 1) {
    for (int i = 0; i < N - 1; i++) {
      L[i + 2] = L[i + 1] + L[i];
    }
  }

  cout << L[N] << endl;
}

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

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

  vector<int64_t> L(N + 1);
  L[0] = 2;
  L[1] = 1;

  if (N > 1) {
    for (int i = 0; i < N - 1; i++) {
      L[i + 2] = L[i + 1] + L[i];
    }
  }

  cout << L[N] << endl;
}
Problem p03544 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>

using namespace std;

int main() {
  int x;
  cin >> x;
  vector<int> vec(86);
  vec[0] = 2;
  vec[1] = 1;

  for (int i = 0; i <= x; i++) {
    if (i >= 2) {
      vec[i] = vec[i - 1] + vec[i - 2];
    }
  }

  cout << vec[x] << endl;
}

Fixed submission:
#include <bits/stdc++.h>

using namespace std;

int main() {
  int x;
  cin >> x;
  vector<int64_t> vec(87);
  vec[0] = 2;
  vec[1] = 1;

  for (int i = 0; i <= x; i++) {
    if (i >= 2) {
      vec[i] = vec[i - 1] + vec[i - 2];
    }
  }

  cout << vec[x] << endl;
}
Problem p03544 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

int main() {
  int N;
  cin >> N;
  vector<int64_t> L(N);

  if (N == 1) {
    L.at(N) = 1;
  } else {
    L.at(0) = 2;
    L.at(1) = 1;
    for (int i = 2; i <= N; i++) {
      L.at(i) = L.at(i - 1) + L.at(i - 2);
    }
  }

  cout << L.at(N) << endl;
}


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

int main() {
  int N;
  cin >> N;
  vector<int64_t> L(N + 1);

  if (N == 1) {
    L.at(N) = 1;
  } else {
    L.at(0) = 2;
    L.at(1) = 1;
    for (int i = 2; i <= N; i++) {
      L.at(i) = L.at(i - 1) + L.at(i - 2);
    }
  }

  cout << L.at(N) << endl;
}
Problem p03544 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <bits/stdc++.h>
using namespace std;

int64_t lucas(int n) {
  if (n == 0) {
    return 2LL;
  } else if (n == 1) {
    return 1LL;
  } else {
    return lucas(n - 1) + lucas(n - 2);
  }
}

int main() {
  int N;
  cin >> N;
  int64_t ans;
  ans = lucas(N);
  cout << ans << endl;
}

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

int64_t lucas(int n) {
  if (n == 0) {
    return 2LL;
  } else if (n == 1) {
    return 1LL;
  } else {
    vector<int64_t> L(n + 1);
    L.at(0) = 2LL;
    L.at(1) = 1LL;
    for (int i = 2; i <= n; i++) {
      L.at(i) = L.at(i - 1) + L.at(i - 2);
    }
    return L.at(n);
  }
}

int main() {
  int N;
  cin >> N;
  int64_t ans;
  ans = lucas(N);
  cout << ans << endl;
}
Problem p03544 (C++)

Buggy submission (status: Runtime Error):
#include <algorithm>
#include <cctype>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#define rep(i, m, n) for (int i = m; i < n; i++)
#define repr(i, n) for (int i = n; i >= 0; i--)
#define ll long long
#define ull unsigned long long
#define push(a) push_back(a)
#define pop(a) pop_back(a)
#define debug(x) cout << #x << ": " << x << endl
#define SORT(v, n) sort(v, v + n);
#define VSORT(v) sort(v.begin(), v.end());
#define INF 999999999
using namespace std;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;

int dy[] = {0, 0, 1, -1, 0};
int dx[] = {1, -1, 0, 0, 0};

int tmp, cnt = 0;
ll a, b, c, d, n, m;
string s;
ll L[86] = {};

int main() {
  L[0] = 2;
  L[1] = 1;
  cin >> n;

  for (int i = 2; i <= n; i++) {
    L[i] = L[i - 1] + L[i - 2];
  }

  cout << L[n] << endl;
}

Fixed submission:
#include <algorithm>
#include <cctype>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#define rep(i, m, n) for (int i = m; i < n; i++)
#define repr(i, n) for (int i = n; i >= 0; i--)
#define ll long long
#define ull unsigned long long
#define push(a) push_back(a)
#define pop(a) pop_back(a)
#define debug(x) cout << #x << ": " << x << endl
#define SORT(v, n) sort(v, v + n);
#define VSORT(v) sort(v.begin(), v.end());
#define INF 999999999
using namespace std;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;

int dy[] = {0, 0, 1, -1, 0};
int dx[] = {1, -1, 0, 0, 0};

int tmp, cnt = 0;
ll a, b, c, d, n, m;
string s;
ull L[87] = {};

int main() {
  L[0] = 2;
  L[1] = 1;
  cin >> n;

  for (int i = 2; i <= n; i++) {
    L[i] = L[i - 1] + L[i - 2];
  }

  cout << L[n] << endl;
}
Problem p03544 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

int main() {
  int N = 0;
  cin >> N;
  vector<int64_t> veca(N);
  if (N == 1) {
    cout << 1 << endl;
  } else {
    veca[0] = 2;
    veca[1] = 1;
    for (int i = 0; i < N - 1; i++) {
      veca[i + 2] = veca[i] + veca[i + 1];
    }

    cout << veca[N] << endl;
  }
}

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

int main() {
  int N = 0;
  cin >> N;
  vector<int64_t> veca(N + 2);
  if (N == 1) {
    cout << 1 << endl;
  } else {
    veca[0] = 2;
    veca[1] = 1;
    for (int i = 0; i < N - 1; i++) {
      veca[i + 2] = veca[i] + veca[i + 1];
    }

    cout << veca[N] << endl;
  }
}
Problem p03544 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
#define ll long long

using namespace std;

int main() {
  int n;
  cin >> n;
  vector<ll> lucas({2, 1});
  if (n >= 3)
    for (int i = 2; i < n + 1; i++)
      lucas.push_back(lucas.at(i - 1) + lucas.at(i - 2));
  cout << lucas.at(n) << endl;
}

Fixed submission:
#include <bits/stdc++.h>
#define ll long long

using namespace std;

int main() {
  int n;
  cin >> n;
  vector<ll> lucas({2, 1});
  if (n >= 2)
    for (int i = 2; i < n + 1; i++)
      lucas.push_back(lucas.at(i - 1) + lucas.at(i - 2));
  cout << lucas.at(n) << endl;
}
Problem p03544 (C++)

Buggy submission (status: Runtime Error):
#include <algorithm>
#include <climits>
#include <cmath>
#include <iostream>
#include <list>
#include <queue>
#include <stack>
#include <stdio.h>
#include <string>
#include <unordered_map>
#include <vector>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; ++i)
#define ALL(v) v.begin(), v.end()
typedef long long ll;

int main() {
  int n;
  cin >> n;
  if (n == 0) {
    cout << 2 << endl;
    return 0;
  }
  vector<ll> L(n + 1);
  L[0] = 2;
  L[1] = 1;

  for (int i = 0; i < n; i++) {
    L[i + 2] = L[i + 1] + L[i];
  }
  cout << L[n] << endl;
  return 0;
}

Fixed submission:
#include <algorithm>
#include <climits>
#include <cmath>
#include <iostream>
#include <list>
#include <queue>
#include <stack>
#include <stdio.h>
#include <string>
#include <unordered_map>
#include <vector>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; ++i)
#define ALL(v) v.begin(), v.end()
typedef long long ll;

int main() {
  int n;
  cin >> n;
  if (n == 0) {
    cout << 2 << endl;
    return 0;
  }
  vector<ll> L(n + 2);
  L[0] = 2;
  L[1] = 1;

  for (int i = 0; i < n; i++) {
    L[i + 2] = L[i + 1] + L[i];
  }
  cout << L[n] << endl;
  return 0;
}
Problem p03544 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <iostream>
using namespace std;
long long z[100];
long long digui(int a) {
  z[0] = 2, z[1] = 1;
  if (a == 1 || a == 0)
    return z[a];
  return digui(a - 1) + digui(a - 2);
}
int main() {
  int n;
  while (cin >> n) {
    cout << digui(n) << endl;
  }
}

Fixed submission:
#include <iostream>
using namespace std;
long long z[100];
long long digui(int a) {
  z[0] = 2, z[1] = 1;
  if (a == 1 || a == 0)
    return z[a];
  else {
    for (int i = 2; i <= a; i++) {
      z[i] = z[i - 1] + z[i - 2];
    }
  }
  return z[a];
}
int main() {
  int n;
  while (cin >> n) {
    cout << digui(n) << endl;
  }
}
Problem p03544 (C++)

Buggy submission (status: Runtime Error):
#include <algorithm>
#include <bitset>
#include <iostream>
#include <map>
#include <string>
#include <vector>

using namespace std;

const int kMaxN = 1e5 + 10;

int main(int argc, char const *argv[]) {
  int ans = 0;
  int n, m, p;
  vector<long> v;
  string s;

  cin >> n;
  v.push_back(2);
  v.push_back(1);
  int i = 2;
  while (i <= n) {
    v[i] = v[i - 1] + v[i - 2];
    ++i;
  }
  cout << v[n] << endl;

  return 0;
}


Fixed submission:
#include <algorithm>
#include <bitset>
#include <iostream>
#include <map>
#include <string>
#include <vector>

using namespace std;

const int kMaxN = 1e5 + 10;

int main(int argc, char const *argv[]) {
  int ans = 0;
  int n, m, p;
  vector<long> v;
  string s;

  cin >> n;
  v.push_back(2);
  v.push_back(1);
  int i = 2;
  while (i <= n) {
    v.push_back(v[i - 1] + v[i - 2]);
    ++i;
  }
  cout << v[n] << endl;

  return 0;
}
Problem p03544 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

int main() {

  int n;
  cin >> n;

  vector<int64_t> lucas(86);

  lucas.at(0) = 2;
  lucas.at(1) = 1;

  for (int i = 2; i < 87; i++) {
    lucas.at(i) = lucas.at(i - 1) + lucas.at(i - 2);
  }

  cout << lucas.at(n);
}


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

int main() {

  int n;
  cin >> n;

  vector<int64_t> lucas(87);

  lucas.at(0) = 2;
  lucas.at(1) = 1;

  for (int i = 2; i < 87; i++) {
    lucas.at(i) = lucas.at(i - 1) + lucas.at(i - 2);
  }

  cout << lucas.at(n);
}
Problem p03544 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <bits/stdc++.h>
using namespace std;

int64_t lucas(int n) {
  if (n == 0)
    return 2;
  else if (n == 1)
    return 1;
  else
    return lucas(n - 1) + lucas(n - 2);
}

int main() {
  int N;
  cin >> N;
  cout << lucas(N) << endl;
}

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

int64_t lucas(int n) {
  if (n == 0)
    return 2;
  else if (n == 1)
    return 1;
  else
    return lucas(n - 1) + lucas(n - 2);
}

int main() {
  int N;
  cin >> N;
  vector<int64_t> lc(N + 1);

  lc.at(0) = 2;
  lc.at(1) = 1;
  for (int i = 2; i <= N; i++)
    lc.at(i) = lc.at(i - 1) + lc.at(i - 2);

  cout << lc.at(N) << endl;
}
Problem p03544 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

int main() {
  int N;
  cin >> N;
  if (N == 0) {
    cout << 2 << endl;
    return 0;
  }
  if (N == 1) {
    cout << 1 << endl;
    return 0;
  }
  vector<long long> lucas(N, 0);
  lucas.at(0) = 2;
  lucas.at(1) = 1;
  for (int i = 2; i < N + 1; i++) {
    lucas.at(i) = lucas.at(i - 1) + lucas.at(i - 2);
    if (i == N) {
      cout << lucas.at(i) << endl;
    }
  }
}


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

int main() {
  int N;
  cin >> N;
  if (N == 0) {
    cout << 2 << endl;
    return 0;
  }
  if (N == 1) {
    cout << 1 << endl;
    return 0;
  }
  vector<long long> lucas(N + 1, 0);
  lucas.at(0) = 2;
  lucas.at(1) = 1;
  for (int i = 2; i < N + 1; i++) {
    lucas.at(i) = lucas.at(i - 1) + lucas.at(i - 2);
    if (i == N) {
      cout << lucas.at(i) << endl;
    }
  }
}
Problem p03544 (C++)

Buggy submission (status: Runtime Error):
#include <iostream>
#include <vector>

using namespace std;

int main() {
  int n = 0;
  cin >> n;

  vector<int64_t> L;
  L.push_back(2);
  L.push_back(1);

  for (int i = 2; i < n; i++) {
    L.at(i) = L.at(i - 2) + L.at(i - 1);
  }
  cout << L.at(n) << endl;
}

Fixed submission:
#include <iostream>
#include <vector>

using namespace std;

int main() {
  int n = 0;
  cin >> n;

  vector<int64_t> L;
  L.push_back(2);
  L.push_back(1);

  for (int i = 2; i <= n; i++) {
    L.push_back(L.at(i - 2) + L.at(i - 1));
  }
  cout << L.at(n) << endl;
}
Problem p03544 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

#define _GLIBCXX_DEBUG

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

  vector<uint64_t> Lucas(N);

  Lucas.at(0) = 2LL;
  Lucas.at(1) = 1LL;
  for (int i = 2; i <= N; i++) {
    Lucas.at(i) = Lucas.at(i - 1) + Lucas.at(i - 2);
  }

  cout << Lucas.back() << endl;
}


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

#define _GLIBCXX_DEBUG

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

  vector<uint64_t> Lucas(N + 1);

  Lucas.at(0) = 2LL;
  Lucas.at(1) = 1LL;
  for (int i = 2; i <= N; i++) {
    Lucas.at(i) = Lucas.at(i - 1) + Lucas.at(i - 2);
  }

  cout << Lucas.back() << endl;
}
Problem p03544 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <bits/stdc++.h>
using namespace std;

int64_t calc(int64_t n) {
  if (n == 0) {
    return 2;
  }
  if (n == 1) {
    return 1;
  }

  return calc(n - 1) + calc(n - 2);
}

int main() {
  int64_t n;
  cin >> n;
  cout << calc(n) << endl;
}

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

int64_t calc(int64_t n) {
  if (n == 0) {
    return 2;
  }
  if (n == 1) {
    return 1;
  }

  int64_t luca = 0;
  int64_t luca_l1 = 1;
  int64_t luca_l2 = 2;
  for (int i = 2; i <= n; i++) {
    luca = luca_l1 + luca_l2;
    luca_l2 = luca_l1;
    luca_l1 = luca;
  }

  return luca;
}

int main() {
  int64_t n;
  cin >> n;
  cout << calc(n) << endl;
}
Problem p03544 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

int main() {
  int N;
  cin >> N;
  vector<long long> L(N + 1);
  L[0] = 2;
  L[1] = 1;
  rep(i, N) { L[i + 2] = L[i] + L[i + 1]; }
  cout << L[N] << endl;
}

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

int main() {
  int N;
  cin >> N;
  vector<long long> L(N + 1);
  L[0] = 2;
  L[1] = 1;
  rep(i, N - 1) { L[i + 2] = L[i] + L[i + 1]; }
  cout << L[N] << endl;
}
Problem p03544 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

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

  vector<int64_t> L(n);

  L[0] = 2;
  L[1] = 1;

  for (int i = 2; i <= n; i++) {
    L[i] = L[i - 1] + L[i - 2];
  }

  cout << L[n] << endl;
}


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

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

  vector<int64_t> L(n + 1);

  L[0] = 2;
  L[1] = 1;

  for (int i = 2; i <= n; i++) {
    L[i] = L[i - 1] + L[i - 2];
  }

  cout << L[n] << endl;
}
Problem p03544 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

int main() {
  int N;
  cin >> N;
  vector<long long> A;
  A[0] = 2;
  A[1] = 1;
  for (int i = 2; i <= N; i++) {
    A[i] = A[i - 1] + A[i - 2];
  }
  cout << A[N] << endl;
  return 0;
}

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

int main() {
  int N;
  cin >> N;
  vector<long long> A(N + 1);
  A[0] = 2;
  A[1] = 1;
  for (int i = 2; i <= N; i++) {
    A[i] = A[i - 1] + A[i - 2];
  }
  cout << A[N] << endl;
  return 0;
}
Problem p03544 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define _GLIBCXX_DEBUG
using namespace std;
using ll = long long;
using P = pair<int, int>;

int main() {
  int N;
  cin >> N;
  vector<ll> v(N + 1);
  if (N == 0) {
    cout << 2 << endl;
    return 0;
  }
  if (N == 1) {
    cout << 1 << endl;
    return 0;
  }
  v[0] = 2;
  v[1] = 1;
  for (int i = 2; i <= N + 1; i++) {
    v[i] = v[i - 1] + v[i - 2];
  }
  cout << v[N] << endl;
  return 0;
}


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

int main() {
  int N;
  cin >> N;
  vector<ll> v(N + 1);
  if (N == 0) {
    cout << 2 << endl;
    return 0;
  }
  if (N == 1) {
    cout << 1 << endl;
    return 0;
  }
  v[0] = 2LL;
  v[1] = 1LL;
  for (int i = 2; i <= N; i++) {
    v[i] = v[i - 1] + v[i - 2];
  }
  cout << v[N] << endl;
  return 0;
}
Problem p03544 (C++)

Buggy submission (status: Runtime Error):
#include <algorithm>
#include <cmath>
#include <iostream>
#include <string>
#include <utility>
#include <vector>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define _GLIBCXX_DEBUG
using namespace std;
typedef long long ll;
typedef pair<int, int> pair;
const int inf = 1000000000; // 10^9

int main() {
  int n;
  cin >> n;
  vector<ll> l(n);
  l[0] = 2;
  l[1] = 1;
  for (int i = 2; i <= n; i++) {
    l[i] = l[i - 1] + l[i - 2];
  }
  cout << l[n] << endl;

  return 0;
}

Fixed submission:
#include <algorithm>
#include <cmath>
#include <iostream>
#include <string>
#include <utility>
#include <vector>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define _GLIBCXX_DEBUG
using namespace std;
typedef long long ll;
typedef pair<int, int> pair;
const int inf = 1000000000; // 10^9

int main() {
  int n;
  cin >> n;
  vector<ll> l(n + 1);
  l[0] = 2;
  l[1] = 1;
  for (int i = 2; i <= n; i++) {
    l[i] = l[i - 1] + l[i - 2];
  }
  cout << l[n] << endl;

  return 0;
}
Problem p03544 (Python)

Buggy submission (status: Runtime Error):
import numpy as np

n = int(input())
init = np.expand_dims(np.array([2, 1]), 0)
to_next = np.array(
    [
        [1, 1],
        [1, 2],
    ]
)
for i in range(n // 2):
    init = init @ to_next
print(init[0][n & 1])


Fixed submission:
import numpy as np

n = int(input())
init = np.expand_dims(np.array([2, 1]), 0)
to_next = np.array(
    [
        [1, 1],
        [1, 2],
    ]
)
for i in range(n // 2):
    init = init.dot(to_next)
print(init[0][n & 1])
Problem p03544 (Python)

Buggy submission (status: Runtime Error):
N = int(input())
L0 = 2
L1 = 1
for i in range(N - 1):
    L2 = L1 + L0
    L0 = L1
    L1 = L2

print(L2)


Fixed submission:
N = int(input())
L0 = 2
L1 = 1
L2 = 1
for i in range(N - 1):
    L2 = L1 + L0
    L0 = L1
    L1 = L2

print(L2)
Problem p03544 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

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

  vector<int64_t> L;
  L.at(0) = 2LL;
  L.at(1) = 1LL;
  for (int i = 2; i <= N; i++) {
    L.at(i) = L.at(i - 1) + L.at(i - 2);
  }
  cout << L.at(N) << endl;
}

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

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

  vector<int64_t> L(87);
  L.at(0) = 2LL;
  L.at(1) = 1LL;
  for (int i = 2; i <= N; i++) {
    L.at(i) = L.at(i - 1) + L.at(i - 2);
  }
  cout << L.at(N) << endl;
}
Problem p03544 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define ALL(A) A.begin(), A.end()
#define RALL(A) A.rbegin(), A.rend()
typedef long long ll;
typedef pair<ll, ll> P;
const ll mod = 1000000007;
const ll LINF = 1LL << 60;
const int INF = 1 << 30;

int main() {
  int n;
  cin >> n;
  vector<ll> dp(n);
  dp[0] = 2;
  dp[1] = 1;
  for (int i = 2; i <= n; i++) {
    dp[i] = dp[i - 1] + dp[i - 2];
  }
  cout << dp[n] << endl;
  return 0;
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define ALL(A) A.begin(), A.end()
#define RALL(A) A.rbegin(), A.rend()
typedef long long ll;
typedef pair<ll, ll> P;
const ll mod = 1000000007;
const ll LINF = 1LL << 60;
const int INF = 1 << 30;

int main() {
  int n;
  cin >> n;
  vector<ll> dp(n + 1);
  dp[0] = 2;
  dp[1] = 1;
  for (int i = 2; i <= n; i++) {
    dp[i] = dp[i - 1] + dp[i - 2];
  }
  cout << dp[n] << endl;
  return 0;
}
Problem p03544 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

int main() {
  int n;
  cin >> n;
  vector<long long int> lucas(86);
  lucas[0] = 2;
  lucas[1] = 1;
  for (int i = 0; i < n; i++) {
    lucas[i + 2] = lucas[i] + lucas[i + 1];
  }
  cout << lucas[n] << endl;
}


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

int main() {
  int n;
  cin >> n;
  vector<long long int> lucas(86);
  lucas[0] = 2;
  lucas[1] = 1;
  for (int i = 0; i < n - 1; i++) {
    lucas[i + 2] = lucas[i] + lucas[i + 1];
  }
  cout << lucas[n] << endl;
}
Problem p03544 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

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

  vector<int64_t> v(N);
  v[0] = 2;
  v[1] = 1;
  for (int i = 2; i <= N; i++) {
    v[i] = v[i - 1] + v[i - 2];
  }
  cout << v[N] << endl;
}

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

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

  vector<int64_t> v(N + 1);
  v[0] = 2;
  v[1] = 1;
  for (int i = 2; i <= N; i++) {
    v[i] = v[i - 1] + v[i - 2];
  }
  cout << v[N] << endl;
}
Problem p03544 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

int main() {
  int N;
  cin >> N;
  vector<uint64_t> L = {2LL, 1LL};
  for (int i = 2; i < N; i++) {
    L.at(i) = L.at(i - 2) + L.at(i - 1);
  }
  cout << L.at(N) << endl;
}


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

int main() {
  int N;
  cin >> N;
  vector<long> L(N + 1);
  L.at(0) = 2;
  L.at(1) = 1;
  for (int i = 2; i < N + 1; i++) {
    L.at(i) = L.at(i - 2) + L.at(i - 1);
  }
  cout << L.at(N) << endl;
}
Problem p03544 (C++)

Buggy submission (status: Runtime Error):
#include <iostream>
using namespace std;
int main() {
  long long n, i, a[60];
  cin >> n;
  a[0] = 2;
  a[1] = 1;
  for (i = 2; i <= n; i++)
    a[i] = a[i - 1] + a[i - 2];
  cout << a[n];
  return 0;
}

Fixed submission:
#include <iostream>
using namespace std;
int main() {
  long long n, i, a[101];
  cin >> n;
  a[0] = 2;
  a[1] = 1;
  for (i = 2; i <= n; i++)
    a[i] = a[i - 1] + a[i - 2];
  cout << a[n];
  return 0;
}
Problem p03544 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

int main() {
  int N;
  cin >> N;
  vector<int64_t> lucas(N);

  lucas.at(0) = 2;
  lucas.at(1) = 1;

  for (int i = 2; i < N + 1; i++) {
    lucas.at(i) = lucas.at(i - 1) + lucas.at(i - 2);
  }

  cout << lucas.at(N) << endl;
}


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

int main() {
  int N;
  cin >> N;
  vector<int64_t> lucas(N + 1);

  lucas.at(0) = 2;
  lucas.at(1) = 1;

  for (int i = 2; i < N + 1; i++) {
    lucas.at(i) = lucas.at(i - 1) + lucas.at(i - 2);
  }

  cout << lucas.at(N) << endl;
}
Problem p03544 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

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

  vector<int long long> a(n);

  a[0] = 2;
  a[1] = 1;

  if (n <= 1) {
    cout << a[n] << endl;
  } else {
    for (int i = 2; i <= n; i++) {
      a[i] = a[i - 1] + a[i - 2];
    }

    cout << a[n] << endl;
  }
}


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

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

  vector<int long long> a(n + 1);

  a[0] = 2;
  a[1] = 1;

  if (n <= 1) {
    cout << a[n] << endl;
  } else {
    for (int i = 2; i <= n; i++) {
      a[i] = a[i - 1] + a[i - 2];
    }

    cout << a[n] << endl;
  }
}
Problem p03544 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

int main() {
  int N;
  cin >> N;
  vector<long long> L(N);
  L[0] = 2;
  L[1] = 1;
  if (N == 1) {
    cout << L[1] << endl;
    return 0;
  }

  for (int i = 2; i <= N; i++) {
    L[i] = L[i - 2] + L[i - 1];
  }

  cout << L[N] << endl;
  return 0;
}

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

int main() {
  int N;
  cin >> N;
  vector<long long> L(100);
  L[0] = 2;
  L[1] = 1;
  if (N == 1) {
    cout << L[1] << endl;
    return 0;
  }

  for (int i = 2; i <= N; i++) {
    L[i] = L[i - 2] + L[i - 1];
  }

  cout << L[N] << endl;
  return 0;
}
Problem p03544 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;

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

  vector<ll> L(N);

  L[0] = 2;
  L[1] = 1;
  for (int i = 2; i <= N; i++) {
    L[i] = L[i - 1] + L[i - 2];
  }

  cout << L[N] << endl;
}


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

typedef long long ll;

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

  vector<ll> L(N + 1);

  L[0] = 2;
  L[1] = 1;
  for (int i = 2; i <= N; i++) {
    L[i] = L[i - 1] + L[i - 2];
  }

  cout << L[N] << endl;
}
Problem p03544 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<int64_t> lucas(N);
  lucas.at(1) = 2;
  lucas.at(2) = 1;
  for (int i = 0; i < N; i++) {
    lucas.at(i + 2) = lucas.at(i + 1) + lucas.at(i);
  }
  cout << lucas.at(N) << endl;
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<int64_t> lucas(N + 1);
  lucas.at(0) = 2;
  lucas.at(1) = 1;
  for (int i = 2; i <= N; i++) {
    lucas.at(i) = lucas.at(i - 1) + lucas.at(i - 2);
  }
  cout << lucas.at(N) << endl;
}
Problem p03544 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

int main() {
  int n;
  cin >> n;
  vector<long> l(n);
  if (n == 1) {
    cout << 1 << endl;
  } else {
    l.at(0) = 2;
    l.at(1) = 1;
    for (int i = 2; i <= n; i++) {
      l.at(i) = l.at(i - 2) + l.at(i - 1);
    }
    cout << l.at(n) << endl;
  }
}


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

int main() {
  int n;
  cin >> n;
  vector<long> l(n + 1);
  if (n == 1) {
    cout << 1 << endl;
  } else {
    l.at(0) = 2;
    l.at(1) = 1;
    for (int i = 2; i <= n; i++) {
      l.at(i) = l.at(i - 2) + l.at(i - 1);
    }
    cout << l.at(n) << endl;
  }
}
Problem p03544 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
int main() {
  int num, i;
  cin >> num;
  vector<int> n(80);
  n.at(0) = 2;
  n.at(1) = 1;
  for (i = 2; i <= num; i++) {
    n.at(i) = n.at(i - 1) + n.at(i - 2);
  }
  cout << n.at(num) << endl;
}


Fixed submission:
#include <bits/stdc++.h>
using namespace std;
int main() {
  int num, i;
  cin >> num;
  vector<long int> n(87);
  n.at(0) = 2LL;
  n.at(1) = 1LL;
  for (i = 2; i <= num; i++) {
    n.at(i) = n.at(i - 1) + n.at(i - 2);
  }
  cout << n.at(num) << endl;
}
Problem p03544 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
// マクロ
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
// 型エイリアス
using ll = long long;
using vi = vector<int>;
using vs = vector<string>;
using vvi = vector<vi>;
using vvs = vector<vs>;

int main() {
  int n;
  cin >> n;
  vector<ll> l(n);
  l[0] = 2;
  l[1] = 1;
  for (int i = 2; i <= n; i++) {
    l[i] = l[i - 1] + l[i - 2];
  }
  cout << l[n] << endl;
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;
// マクロ
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
// 型エイリアス
using ll = long long;
using vi = vector<int>;
using vs = vector<string>;
using vvi = vector<vi>;
using vvs = vector<vs>;

int main() {
  int n;
  cin >> n;
  vector<ll> l(n + 1);
  l[0] = 2;
  l[1] = 1;
  for (int i = 2; i <= n; i++) {
    l[i] = l[i - 1] + l[i - 2];
  }
  cout << l[n] << endl;
}
Problem p03544 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>

using namespace std;

int main() {
  int N;
  cin >> N;
  vector<int64_t> V(N);
  V[0] = 2;
  V[1] = 1;
  for (int i = 2; i <= N; i++) {
    V[i] = V[i - 1] + V[i - 2];
  }
  cout << V[N];

  return 0;
}


Fixed submission:
#include <bits/stdc++.h>

using namespace std;

int main() {
  int N;
  cin >> N;
  vector<int64_t> V(N + 1);
  V[0] = 2;
  V[1] = 1;
  for (int i = 2; i <= N; i++) {
    V[i] = V[i - 1] + V[i - 2];
  }
  cout << V[N];

  return 0;
}
Problem p03544 (C++)

Buggy submission (status: Runtime Error):
#include <iostream>
#include <vector>
using namespace std;

int main() {
  int N;
  cin >> N;
  vector<long long> lucas(N);
  lucas[0] = 2;
  lucas[1] = 1;
  for (int i = 2; i <= N; i++) {
    lucas[i] = lucas[i - 1] + lucas[i - 2];
  }
  cout << lucas[N] << endl;
}


Fixed submission:
#include <iostream>
#include <vector>
using namespace std;

int main() {
  int N;
  cin >> N;
  vector<long long> lucas(86);
  lucas[0] = 2;
  lucas[1] = 1;
  for (int i = 2; i <= N; i++) {
    lucas[i] = lucas[i - 1] + lucas[i - 2];
  }
  cout << lucas[N] << endl;
}
Problem p03544 (C++)

Buggy submission (status: Runtime Error):
#include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <utility>
#include <vector>
using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<double, double> pdd;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vi> vvi;
typedef set<int> si;
typedef map<int, int> mii;
#define INF (1 << 29)

int main() {
  int n;
  cin >> n;
  vector<long long> ryu(n + 1);
  ryu[0] = 2;
  ryu[1] = 1;

  int i = 2;
  while (i <= n + 1) {
    ryu[i] = ryu[i - 2] + ryu[i - 1];
    i++;
  }
  cout << ryu[n] << endl;
  return 0;
}

Fixed submission:
#include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <utility>
#include <vector>
using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<double, double> pdd;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vi> vvi;
typedef set<int> si;
typedef map<int, int> mii;
#define INF (1 << 29)

int main() {
  int n;
  cin >> n;
  vector<long long> ryu(n + 1);
  ryu[0] = 2;
  ryu[1] = 1;

  int i = 2;
  while (i <= n) {
    ryu[i] = ryu[i - 2] + ryu[i - 1];
    i++;
  }
  cout << ryu[n] << endl;
  return 0;
}
Problem p03544 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)n; i++)
typedef long long ll;

int main(void) {
  int a;
  scanf("%d", &a);
  vector<ll> v = {2, 1};
  for (int i = 2; i < a; i++) {
    v.push_back(v.at(i - 2) + v.at(i - 1));
  }
  printf("%ld", v.at(a - 1) + v.at(a - 2));
}


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

int main(void) {
  int a;
  scanf("%d", &a);
  if (a == 1) {
    cout << 1 << endl;
    return 0;
  }
  vector<ll> v = {2, 1};
  for (int i = 2; i < a; i++) {
    v.push_back(v.at(i - 2) + v.at(i - 1));
  }
  printf("%ld", v.at(a - 1) + v.at(a - 2));
}
Problem p03544 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

// リュカ数

int main() {
  int N;
  cin >> N;
  vector<int64_t> a(N);
  if (N == 1) {
    cout << 1 << endl;
    return 1;
  }
  a.at(0) = 2;
  a.at(1) = 1;

  for (int i = 2; i <= N; i++) {
    a.at(i) = a.at(i - 1) + a.at(i - 2);
  }

  printf("%lld", a.at(N));
  cout << endl;
  return 0;
}


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

// リュカ数

int main() {
  int N;
  cin >> N;
  vector<int64_t> a(87);

  a.at(0) = 2;
  a.at(1) = 1;

  for (int i = 2; i <= N; i++) {
    a.at(i) = a.at(i - 1) + a.at(i - 2);
  }

  printf("%lld", a.at(N));
  cout << endl;
  return 0;
}
Problem p03544 (C++)

Buggy submission (status: Runtime Error):
#include <algorithm>
#include <iostream>

using namespace std;
typedef long long Int;
#define INF (1LL << 60)

Int N;
Int res[900];

Int solve(int x) {
  res[x] = res[x - 1] + res[x - 2];
  x += 1;
  if (x - 1 == N)
    return res[x - 1];
  else
    return solve(x);
}

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

  cin >> N;
  res[0] = 2;
  res[1] = 1;
  cout << solve(2) << endl;
  return 0;
}

Fixed submission:
#include <algorithm>
#include <iostream>

using namespace std;
typedef long long Int;
#define INF (1LL << 60)

Int N;
Int res[900];

Int solve(int x) {
  res[x] = res[x - 1] + res[x - 2];
  x += 1;
  if (x - 1 == N)
    return res[x - 1];
  else
    return solve(x);
}

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

  cin >> N;
  res[0] = 2;
  res[1] = 1;
  for (Int i = 2; i <= N; i++)
    res[i] = res[i - 1] + res[i - 2];
  cout << res[N] << endl;
  return 0;
}
Problem p03544 (C++)

Buggy submission (status: Runtime Error):
#include <algorithm>
#include <iostream>
#include <map>
#include <queue>
#include <string>
#include <vector>
typedef long long ll;
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define mod 1000000007

int main() {
  int N;
  cin >> N;
  vector<long long> L(N);
  L[0] = 2;
  L[1] = 1;
  for (int i = 2; i <= N; i++) {
    L[i] = L[i - 2] + L[i - 1];
  }
  cout << L[N] << endl;
}

Fixed submission:
#include <algorithm>
#include <iostream>
#include <map>
#include <queue>
#include <string>
#include <vector>
typedef long long ll;
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define mod 1000000007

int main() {
  int N;
  cin >> N;
  vector<long long> L(86);
  L[0] = 2;
  L[1] = 1;
  for (int i = 2; i <= N; i++) {
    L[i] = L[i - 2] + L[i - 1];
  }
  cout << L[N] << endl;
}
Problem p03544 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>

int n;
std::vector<long long int> vec;

int main() {
  std::cin >> n;
  vec.assign(n, 0);
  vec[0] = 2;
  vec[1] = 1;

  for (int i = 2; i <= n; i++) {
    vec[i] = vec[i - 1] + vec[i - 2];
  }
  std::cout << vec[n] << std::endl;
}


Fixed submission:
#include <bits/stdc++.h>

int n;
std::vector<long long int> vec;

int main() {
  std::cin >> n;
  vec.assign(n + 1, 0);
  vec[0] = 2;
  vec[1] = 1;

  for (int i = 2; i <= n; i++) {
    vec[i] = vec[i - 1] + vec[i - 2];
  }
  std::cout << vec[n] << std::endl;
}
Problem p03544 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

#define rep(i, n) for (int i = (int)(0); i < (int)(n); ++i)
#define reps(i, n) for (int i = (int)(1); i <= (int)(n); ++i)
#define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rreps(i, n) for (int i = ((int)(n)); i > 0; i--)
#define irep(i, m, n) for (int i = (int)(m); i < (int)(n); ++i)
#define ireps(i, m, n) for (int i = (int)(m); i <= (int)(n); ++i)
#define FOR(e, c) for (auto &e : c)
#define SORT(v, n) sort(v, v + n);
#define vsort(v) sort(v.begin(), v.end());
#define rvisort(v) sort(v.begin(), v.end(), greater<int>());
#define all(v) v.begin(), v.end()
#define mp(n, m) make_pair(n, m);
#define cout(d) cout << d << endl;
#define coutd(d) cout << std::setprecision(10) << d << endl;
#define cinline(n) getline(cin, n);
#define replace_all(s, b, a) replace(s.begin(), s.end(), b, a);

using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using pii = pair<int, int>;
using vpii = vector<pii>;
using vs = vector<string>;
using vd = vector<double>;
using ul = unsigned long;

template <class T, class C> void chmax(T &a, C b) { a > b ?: a = b; }
template <class T, class C> void chmin(T &a, C b) { a < b ?: a = b; }

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

  int n;
  cin >> n;
  vi dp(86);
  dp[0] = 2;
  dp[1] = 1;
  for (int i = 2; i <= n; i++) {
    dp[i] = dp[i - 2] + dp[i - 1];
  }
  cout(dp[n]);
  return 0;
}

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

#define rep(i, n) for (int i = (int)(0); i < (int)(n); ++i)
#define reps(i, n) for (int i = (int)(1); i <= (int)(n); ++i)
#define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rreps(i, n) for (int i = ((int)(n)); i > 0; i--)
#define irep(i, m, n) for (int i = (int)(m); i < (int)(n); ++i)
#define ireps(i, m, n) for (int i = (int)(m); i <= (int)(n); ++i)
#define FOR(e, c) for (auto &e : c)
#define SORT(v, n) sort(v, v + n);
#define vsort(v) sort(v.begin(), v.end());
#define rvisort(v) sort(v.begin(), v.end(), greater<int>());
#define all(v) v.begin(), v.end()
#define mp(n, m) make_pair(n, m);
#define cout(d) cout << d << endl;
#define coutd(d) cout << std::setprecision(10) << d << endl;
#define cinline(n) getline(cin, n);
#define replace_all(s, b, a) replace(s.begin(), s.end(), b, a);

using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using pii = pair<int, int>;
using vpii = vector<pii>;
using vs = vector<string>;
using vd = vector<double>;
using ul = unsigned long;

template <class T, class C> void chmax(T &a, C b) { a > b ?: a = b; }
template <class T, class C> void chmin(T &a, C b) { a < b ?: a = b; }

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

  int n;
  cin >> n;
  vll dp(86);
  dp[0] = 2;
  dp[1] = 1;
  for (int i = 2; i <= n; i++) {
    dp[i] = dp[i - 2] + dp[i - 1];
  }
  cout(dp[n]);
  return 0;
}
Problem p03544 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>

using namespace std;

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

int main() {
  /* code */
  int n;
  cin >> n;
  vector<long long> A(n);
  A.at(0) = 2;
  A.at(1) = 1;
  rep(i, n - 1) { A.at(i + 2) = A.at(i + 1) + A.at(i); }
  cout << A.at(n) << endl;
  return 0;
}

Fixed submission:
#include <bits/stdc++.h>

using namespace std;

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

int main() {
  /* code */
  int n;
  cin >> n;
  vector<long long> A(n + 10);
  A.at(0) = 2;
  A.at(1) = 1;
  rep(i, n - 1) { A.at(i + 2) = A.at(i + 1) + A.at(i); }
  cout << A.at(n) << endl;
  return 0;
}
Problem p03544 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

int main() {
  int n;
  cin >> n;
  vector<long long int> l(n);
  l[0] = 2;
  l[1] = 1;
  for (int i = 2; i <= n; i++) {
    l[i] = l[i - 1] + l[i - 2];
  }
  cout << l[n];
}

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

int main() {
  int n;
  cin >> n;
  long long int l[87];
  l[0] = 2;
  l[1] = 1;
  for (int i = 2; i <= n; i++) {
    l[i] = l[i - 1] + l[i - 2];
  }
  cout << l[n];
}
Problem p03544 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

#define REP(i, m, n) for (int i = (m); i < (int)(n); i++)
#define REPS(i, m, n) for (int i = (m); i <= (int)(n); i++)
#define rep(i, n) REP(i, 0, n)
#define reps(i, n) for (int i = 0; i <= (int)(n); i++)
#define rrep(i, x) for (int i = ((int)(x)-1); i >= 0; i--)
#define rreps(i, x) for (int i = (int)(x); i >= 0; i--)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define pb push_back
#define fi first
#define se second
typedef long long ll;
typedef pair<int, int> P;
const int inf = INT_MAX;
const ll INF = 1LL << 60;
const ll mod = 1e9 + 7;
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 <typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val) {
  fill((T *)array, (T *)(array + N), val);
}

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

  ll N;
  cin >> N;
  vector<ll> L;

  L.pb(2);
  L.pb(1);
  REPS(i, 2, N) { L[i] = L[i - 1] + L[i - 2]; }
  cout << L[N] << endl;
  return 0;
}

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

#define REP(i, m, n) for (int i = (m); i < (int)(n); i++)
#define REPS(i, m, n) for (int i = (m); i <= (int)(n); i++)
#define rep(i, n) REP(i, 0, n)
#define reps(i, n) for (int i = 0; i <= (int)(n); i++)
#define rrep(i, x) for (int i = ((int)(x)-1); i >= 0; i--)
#define rreps(i, x) for (int i = (int)(x); i >= 0; i--)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define pb push_back
#define fi first
#define se second
typedef long long ll;
typedef pair<int, int> P;
const int inf = INT_MAX;
const ll INF = 1LL << 60;
const ll mod = 1e9 + 7;
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 <typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val) {
  fill((T *)array, (T *)(array + N), val);
}

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

  ll N;
  cin >> N;
  vector<ll> L;

  L.pb(2);
  L.pb(1);
  REPS(i, 2, N) { L.pb(L[i - 1] + L[i - 2]); }
  cout << L[N] << endl;
  return 0;
}
Problem p03544 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

int main() {
  int N;
  vector<long long int> L(85);

  cin >> N;
  L[0] = 2;
  L[1] = 1;
  if (N > 1) {
    for (int i = 2; i <= N; i++) {
      L[i] = L[i - 1] + L[i - 2];
    }
  }
  cout << L[N] << endl;
}

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

int main() {
  int N;
  vector<long long int> L(90);

  cin >> N;
  L[0] = 2;
  L[1] = 1;
  if (N > 1) {
    for (int i = 2; i <= N; i++) {
      L[i] = L[i - 1] + L[i - 2];
    }
  }
  cout << L[N] << endl;
}
Problem p03544 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define SORT(v, n) sort(v, v + n);
#define VSORT(v) sort(v.begin(), v.end())
#define VRSORT(v) sort(v.rbegin(), v.rend()) // vectorの降順ソート
#define ll long long
#define pb(a) push_back(a)
#define INF 1000000000
#define MOD 1000000007
using namespace std;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;

typedef vector<unsigned int> vec;
typedef vector<vec> mat;
typedef tuple<ll, ll, ll> T;

int dy[] = {0, 0, 1, -1, 0};
int dx[] = {1, -1, 0, 0, 0};

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  ll ans = 0;
  vector<ll> l(n);
  l[0] = 2;
  l[1] = 1;
  for (int i = 2; i <= n; i++) {
    l[i] = l[i - 2] + l[i - 1];
  }
  cout << l[n] << endl;
}

Fixed submission:
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define SORT(v, n) sort(v, v + n);
#define VSORT(v) sort(v.begin(), v.end())
#define VRSORT(v) sort(v.rbegin(), v.rend()) // vectorの降順ソート
#define ll long long
#define pb(a) push_back(a)
#define INF 1000000000
#define MOD 1000000007
using namespace std;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;

typedef vector<unsigned int> vec;
typedef vector<vec> mat;
typedef tuple<ll, ll, ll> T;

int dy[] = {0, 0, 1, -1, 0};
int dx[] = {1, -1, 0, 0, 0};

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  ll ans = 0;
  vector<ll> l(n + 1);
  l[0] = 2;
  l[1] = 1;
  for (int i = 2; i <= n; i++) {
    l[i] = l[i - 2] + l[i - 1];
  }
  cout << l[n] << endl;
}
Problem p03544 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
#define FOR(i, m, n) for (ll i = m; i < (n); i++)
#define RFOR(i, m, n) for (ll i = (m - 1); i >= 0; i--)
#define REP(i, n) FOR(i, 0, n)
#define RREP(i, n) RFOR(i, n, 0)
#define ALL(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()
// #define print(ele) cout << (ele) << "\n"
#define print10(ele) cout << fixed << setprecision(10) << (ele) << "\n"

using namespace std;
typedef long long ll;
typedef vector<int> ivec;
typedef vector<string> svec;
typedef vector<ll> lvec;

const int mod = 1e9 + 7;
const ll INF = 1000000000000000000LL;

void print() { cout << endl; }

template <class Head, class... Tail> void print(Head &&head, Tail &&...tail) {
  cout << head;
  if (sizeof...(tail) != 0)
    cout << " ";
  print(forward<Tail>(tail)...);
}

int main() {
  int n;
  cin >> n;
  ll ans;
  lvec l(n);
  l[0] = 2;
  l[1] = 1;
  FOR(i, 2, n + 1) { l[i] = l[i - 1] + l[i - 2]; }
  ans = l[n];
  print(ans);
  return 0;
}

Fixed submission:
#include <bits/stdc++.h>
#define FOR(i, m, n) for (ll i = m; i < (n); i++)
#define RFOR(i, m, n) for (ll i = (m - 1); i >= 0; i--)
#define REP(i, n) FOR(i, 0, n)
#define RREP(i, n) RFOR(i, n, 0)
#define ALL(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()
// #define print(ele) cout << (ele) << "\n"
#define print10(ele) cout << fixed << setprecision(10) << (ele) << "\n"

using namespace std;
typedef long long ll;
typedef vector<int> ivec;
typedef vector<string> svec;
typedef vector<ll> lvec;

const int mod = 1e9 + 7;
const ll INF = 1000000000000000000LL;

void print() { cout << endl; }

template <class Head, class... Tail> void print(Head &&head, Tail &&...tail) {
  cout << head;
  if (sizeof...(tail) != 0)
    cout << " ";
  print(forward<Tail>(tail)...);
}

int main() {
  int n;
  cin >> n;
  ll ans;
  lvec l(n + 1);
  l[0] = 2;
  l[1] = 1;
  FOR(i, 2, n + 1) { l[i] = l[i - 1] + l[i - 2]; }
  ans = l[n];
  print(ans);
  return 0;
}
Problem p03544 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <bits/stdc++.h>
using namespace std;
#define ll long long

ll lucas(ll num) {
  if (num == 0)
    return 2;
  if (num == 1)
    return 1;
  return lucas(num - 1) + lucas(num - 2);
}

int main() {
  ll N;
  cin >> N;
  cout << lucas(N) << endl;
}


Fixed submission:
#include <bits/stdc++.h>
using namespace std;
#define ll long long

ll lucas(ll num) {
  if (num == 0)
    return 2;
  if (num == 1)
    return 1;
  return lucas(num - 1) + lucas(num - 2);
}

int main() {
  ll N;
  cin >> N;
  vector<ll> lucas(87);
  lucas.at(0) = 2;
  lucas.at(1) = 1;
  if (N == 0 || N == 1) {
    cout << lucas.at(N) << endl;
    return 0;
  }
  for (int i = 2; i <= N; i++) {
    lucas.at(i) = lucas.at(i - 1) + lucas.at(i - 2);
  }
  cout << lucas.at(N) << endl;
}
Problem p03544 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int main() {
  int n;
  cin >> n;
  vector<ll> l(n + 1);
  l[0] = 2;
  l[1] = 1;
  for (int i = 2; i <= n + 1; i++) {
    l[i] = l[i - 1] + l[i - 2];
  }
  cout << l[n] << endl;
  return 0;
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int main() {
  int n;
  cin >> n;
  vector<ll> l(n + 1);
  l[0] = 2;
  l[1] = 1;
  for (int i = 2; i <= n; i++) {
    l[i] = l[i - 1] + l[i - 2];
  }
  cout << l[n] << endl;
  return 0;
}
Problem p03544 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

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

  vector<int64_t> v;
  v.at(0) = 2;
  v.at(1) = 1;
  for (int i = 2; i <= n; i++) {
    v.at(i) = v.at(i - 1) + v.at(i - 2);
  }

  cout << v.at(n) << endl;
}


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

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

  vector<uint64_t> v(n + 1);
  v.at(0) = 2;
  v.at(1) = 1;
  for (int i = 2; i <= n; i++) {
    v.at(i) = v.at(i - 1) + v.at(i - 2);
  }

  cout << v.at(n) << endl;
}