/ Randle /

记录详情

Memory Exceeded


  
# 状态 耗时 内存占用
#1 Wrong Answer 1ms 200.0 KiB
#2 Wrong Answer 1ms 204.0 KiB
#3 Wrong Answer 1ms 204.0 KiB
#4 Accepted 1ms 208.0 KiB
#5 Accepted 1ms 204.0 KiB
#6 Accepted 1ms 204.0 KiB
#7 Accepted 1ms 200.0 KiB
#8 Memory Exceeded ≥354ms ≥256.0 MiB
#9 Accepted 1ms 192.0 KiB
#10 Accepted 1ms 196.0 KiB

代码

#include <iostream>
using namespace std;
#define NUM 1000000007
#define JianGe 100000000
int main(){
    int n;
    cin>>n;
    long long array1[10] = {945351196,80688602,800447448,947746097,220121405,539612979,850278613,975243705,442753488,999999994};
    long long array2[10] = {853811327,452664165,768435528,340207074,84908948,544273633,243519942,505386617,105110174,8};
    int index = n/JianGe;
    int new_n = n-index*JianGe;
    long long *temp = new long long[new_n+1];
    temp[0]=array1[index-1];temp[1]=array2[index-1];
    for(int i=2;i<=new_n;i++)
        temp[i] = ((temp[i-1]+temp[i-2])%NUM)%NUM;
    cout<<temp[new_n]<<endl;
    return 0;
}

信息

递交者
类型
递交
题目
上楼梯(数据原创)
题目数据
下载
语言
C++
递交时间
2020-01-10 21:10:01
评测时间
2020-01-10 21:10:01
评测机
分数
60
总耗时
≥368ms
峰值内存
≥256.0 MiB