Submission #424879

# Submission time Handle Problem Language Result Execution time Memory
424879 2021-06-12T11:07:24 Z A_D Fibonacci representations (CEOI18_fib) C++14
0 / 100
1 ms 204 KB
#include <bits/stdc++.h>
#define int long long
#define ii pair<int,int>
#define F first
#define S second
#define du long double
using namespace std;
const int MOD=1e9+7;
void solve()
{
    int n,mx=0,cnt=0;
    cin>>n;
    while(n--){
        int a;
        cin>>a;
        if(a==1){
            cnt=1;
        }
        mx=max(mx,a);
        int ans;
        if(cnt==0){
            ans=(mx+1)/2;
            ans%=MOD;
        }
        else{
            if(mx==1)ans=1;
            else{
                ans=mx/2;
                ans%=MOD;
            }
        }
        cout<<ans<<endl;
    }
}
main()
{
    int t=1;
    //cin>>t;
    while(t--)solve();
}

Compilation message

fib.cpp:35:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   35 | main()
      | ^~~~
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -