10 solutions

  • 0
    @ 2023-10-25 21:23:23
    #include <stdio.h>
    #pragma warning (disable:4996)
    
    int main() {
        int n;
        scanf("%d", &n);
        long long a = 0, b = 1, c;
        for (int i = 2; i <= n; i++) 
        {
            c = (a + b) % 10007;
            a = b;
            b = c;
        }
        printf("%lld", b);
            return 0;
    }
    
    

    Information

    ID
    38
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    8
    Tags
    # Submissions
    2327
    Accepted
    309
    Uploaded By