Submission #68901311


Source Code Expand

#include <bits/stdc++.h>

using namespace std;

using LL = long long;
#define endl '\n'
using db = double;
template <class T>
using max_heap = priority_queue<T>;
template <class T>
using min_heap = priority_queue<T, vector<T>, greater<T>>;

LL calc(LL x)
{
    auto s = to_string(x);
    reverse(s.begin(), s.end());
    return stoll(s.substr());
}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    vector<LL> a(14);
    cin >> a[1] >> a[2];
    for (int i = 3; i <= 10; ++i)
    {
        a[i] = calc(a[i - 1] + a[i - 2]);
    }
    cout << a[10] << endl;
    return 0;
}

Submission Info

Submission Time
Task B - Fibonacci Reversed
User hialine
Language C++ 20 (gcc 12.2)
Score 200
Code Size 626 Byte
Status AC
Exec Time 1 ms
Memory 3568 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 3
AC × 16
Set Name Test Cases
Sample 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt
All 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 01_random_00.txt, 01_random_01.txt, 01_random_02.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 01_random_06.txt, 01_random_07.txt, 02_handmade_00.txt, 02_handmade_01.txt, 02_handmade_02.txt, 02_handmade_03.txt, 02_handmade_04.txt
Case Name Status Exec Time Memory
00_sample_00.txt AC 1 ms 3564 KiB
00_sample_01.txt AC 1 ms 3548 KiB
00_sample_02.txt AC 1 ms 3392 KiB
01_random_00.txt AC 1 ms 3556 KiB
01_random_01.txt AC 1 ms 3484 KiB
01_random_02.txt AC 1 ms 3416 KiB
01_random_03.txt AC 1 ms 3568 KiB
01_random_04.txt AC 1 ms 3480 KiB
01_random_05.txt AC 1 ms 3484 KiB
01_random_06.txt AC 1 ms 3484 KiB
01_random_07.txt AC 1 ms 3560 KiB
02_handmade_00.txt AC 1 ms 3556 KiB
02_handmade_01.txt AC 1 ms 3556 KiB
02_handmade_02.txt AC 1 ms 3556 KiB
02_handmade_03.txt AC 1 ms 3552 KiB
02_handmade_04.txt AC 1 ms 3484 KiB