結果

問題 No.721 Die tertia (ディエ・テルツィア)
ユーザー YukimotoPGYukimotoPG
提出日時 2019-02-13 10:16:26
言語 Java21
(openjdk 21)
結果
AC  
実行時間 211 ms / 2,000 ms
コード長 535 bytes
コンパイル時間 2,126 ms
コンパイル使用メモリ 71,900 KB
実行使用メモリ 58,452 KB
最終ジャッジ日時 2023-10-11 11:07:16
合計ジャッジ時間 7,879 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 195 ms
56,828 KB
testcase_01 AC 192 ms
56,460 KB
testcase_02 AC 199 ms
56,648 KB
testcase_03 AC 205 ms
56,832 KB
testcase_04 AC 203 ms
56,848 KB
testcase_05 AC 199 ms
58,452 KB
testcase_06 AC 211 ms
57,624 KB
testcase_07 AC 200 ms
57,308 KB
testcase_08 AC 197 ms
57,120 KB
testcase_09 AC 190 ms
56,788 KB
testcase_10 AC 188 ms
56,844 KB
testcase_11 AC 189 ms
56,980 KB
testcase_12 AC 190 ms
56,164 KB
testcase_13 AC 199 ms
56,836 KB
testcase_14 AC 199 ms
56,968 KB
testcase_15 AC 199 ms
57,172 KB
testcase_16 AC 195 ms
56,432 KB
testcase_17 AC 200 ms
57,112 KB
testcase_18 AC 202 ms
56,728 KB
testcase_19 AC 200 ms
56,724 KB
testcase_20 AC 198 ms
56,620 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.text.SimpleDateFormat;
import java.util.*;

class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		
		String s = sc.next();
		int y = Integer.parseInt(s.substring(0,4));
		int m = Integer.parseInt(s.substring(5,7)) - 1;
		int d = Integer.parseInt(s.substring(8,10));
		
		Calendar cl = Calendar.getInstance();
		cl.set(y, m, d);
		cl.add(Calendar.DATE, 2);
		
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd");
		System.out.println(sdf.format(cl.getTime()));
		
	}
}
0