/ Randle /

记录详情

Runtime Error

/in/Main.java:3: warning: IREM is internal proprietary API and may be removed in a future release
import com.sun.org.apache.bcel.internal.generic.IREM;
                                               ^
1 warning
# 状态 耗时 内存占用
#1 Wrong Answer 84ms 12.129 MiB
#2 Wrong Answer 84ms 12.145 MiB
#3 Wrong Answer 85ms 13.242 MiB
#4 Runtime Error 93ms 17.59 MiB
#5 Runtime Error 95ms 17.785 MiB
#6 Runtime Error 94ms 17.551 MiB
#7 Runtime Error 97ms 17.672 MiB
#8 Runtime Error 98ms 18.609 MiB
#9 Runtime Error 95ms 17.559 MiB
#10 Runtime Error 94ms 16.27 MiB

代码

import java.util.Scanner;

import com.sun.org.apache.bcel.internal.generic.IREM;

public class Main {
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		if (n==1) {
			System.out.println(1);
		}else if (n==2) {
			System.out.println(2);
		}else if (n==3) {
			System.out.println(4);
		}else {
			long []array = new long[n+1];
			array[1]=1;
			array[2]=2;
			array[3]=4;
			for (int i = 4; i <= n; i++) {
				array[i]=(array[i-1]+array[i-2]+array[i-3])%1000000007;
			}
		}
	}
}

信息

递交者
类型
递交
题目
上楼梯(数据原创)
题目数据
下载
语言
Java
递交时间
2019-10-28 09:18:15
评测时间
2019-10-28 09:18:15
评测机
分数
0
总耗时
925ms
峰值内存
18.609 MiB