結果
問題 |
No.207 世界のなんとか
|
ユーザー |
|
提出日時 | 2017-09-25 12:13:51 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 507 bytes |
コンパイル時間 | 3,864 ms |
コンパイル使用メモリ | 111,268 KB |
実行使用メモリ | 28,308 KB |
最終ジャッジ日時 | 2024-11-14 13:17:45 |
合計ジャッジ時間 | 5,115 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 10 WA * 9 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System; public class Test { public static int GetDigit (long value) { int digit = 0; while (value > 0) { value /= 10; digit++; } return digit; } public static void Main(string[] args) { string[] nums = Console.ReadLine().Split(' '); long min = long.Parse(nums[0]); // min >= 1 long max = long.Parse(nums[1]); for (long i = min; i <= max; i++) { if (i % 3 == 0|| i % 10 == 3 || (int)(i / System.Math.Pow(10,GetDigit(i)-1)) == 3) { Console.WriteLine(i); } } } }