結果

問題 No.311 z in FizzBuzzString
ユーザー 37zigen
提出日時 2016-03-11 02:31:36
言語 Java
(openjdk 23)
結果
TLE  
実行時間 -
コード長 450 bytes
コンパイル時間 2,152 ms
コンパイル使用メモリ 76,456 KB
実行使用メモリ 61,368 KB
最終ジャッジ日時 2024-09-24 21:35:47
合計ジャッジ時間 6,488 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 7 TLE * 1 -- * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Date;
import java.util.Scanner;
public class Main{
	public static void main(String[] args){
		long exec_time=new Date().getTime();
		Scanner sc=new Scanner(System.in);
		long n=sc.nextLong();
		int ans=0;
		for(long i=1;i<=n;i++){
			if(i%3==0&&i%5==0){
				ans+=4;
			}else if(i%3==0){
				ans+=2;
			}else if(i%5==0){
				ans+=2;
			}
		}
		System.out.println(ans);
		System.err.println(new Date().getTime()-exec_time+"ans");
	}
}
0