Submission #68914605


Source Code Expand

#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <cmath>
#include <bitset>
#include <numeric>
using namespace std;
#define ll long long
#define vi vector<int>
#define vs vector<string>
#define vll vector<long long>
#define vii vector<pair<int, int>>
#define vllvector vector<pair<ll, ll>>
#define vb vector<bool>
#define yes cout << "Yes" << endl;
#define no cout << "No" << endl;
#define rep(i, n) for (int i = 0; i < n; i++)

ll f(ll x) {
    string s = to_string(x);
    reverse(s.begin(), s.end());
    return stoll(s);
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    
    ll x, y;
    cin >> x >> y;
    vll vec(10);
    vec[0] = x;
    vec[1] = y;
    for (int i = 2; i < 10; i++) {
        vec[i] = f(vec[i -1] + vec[i -2]);
    }

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

Submission Info

Submission Time
Task B - Fibonacci Reversed
User kar1neko
Language C++ 20 (gcc 12.2)
Score 200
Code Size 920 Byte
Status AC
Exec Time 1 ms
Memory 3660 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 3476 KiB
00_sample_01.txt AC 1 ms 3436 KiB
00_sample_02.txt AC 1 ms 3380 KiB
01_random_00.txt AC 1 ms 3532 KiB
01_random_01.txt AC 1 ms 3472 KiB
01_random_02.txt AC 1 ms 3512 KiB
01_random_03.txt AC 1 ms 3512 KiB
01_random_04.txt AC 1 ms 3536 KiB
01_random_05.txt AC 1 ms 3524 KiB
01_random_06.txt AC 1 ms 3524 KiB
01_random_07.txt AC 1 ms 3380 KiB
02_handmade_00.txt AC 1 ms 3660 KiB
02_handmade_01.txt AC 1 ms 3660 KiB
02_handmade_02.txt AC 1 ms 3440 KiB
02_handmade_03.txt AC 1 ms 3592 KiB
02_handmade_04.txt AC 1 ms 3380 KiB