結果
問題 |
No.740 幻の木
|
ユーザー |
![]() |
提出日時 | 2018-10-05 22:29:32 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 772 bytes |
コンパイル時間 | 4,001 ms |
コンパイル使用メモリ | 108,384 KB |
実行使用メモリ | 27,768 KB |
最終ジャッジ日時 | 2024-10-12 13:16:04 |
合計ジャッジ時間 | 4,497 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 2 WA * 4 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System; using static System.Console; using static System.Math; public class Hello{ public static void Main(){ string[] input = ReadLine().Split(' '); int[] x = new int[input.Length]; for(int i=0;i<input.Length;i++){ x[i] = int.Parse(input[i]); } int m2 = 1; for(int i=0;i<x[1];i++){ m2 *= 2; } int month = 0; while(x[0] > 0){ month++; int tsuki = month % 12; if(tsuki == 0){ tsuki = 12; } if(x[2] <= tsuki && tsuki <= x[2] + x[3] - 1){ x[0] -= m2; }else{ x[0] -= x[1]; } } WriteLine(month); } }