結果
| 問題 | No.604 誕生日のお小遣い |
| コンテスト | |
| ユーザー |
No
|
| 提出日時 | 2018-01-25 03:25:57 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 895 bytes |
| 記録 | |
| コンパイル時間 | 2,929 ms |
| コンパイル使用メモリ | 104,064 KB |
| 実行使用メモリ | 18,176 KB |
| 最終ジャッジ日時 | 2024-12-26 14:11:18 |
| 合計ジャッジ時間 | 6,231 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 12 WA * 9 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System;
namespace y
{
class Program
{
static void Main(string[] args)
{
var ss = Console.ReadLine().Split();
long a = long.Parse(ss[0]);
long b = long.Parse(ss[1]);
long c = long.Parse(ss[2]);
long ans = 999999999999999999;
for (int i = 17; i >= 0; i--)
{
long n = ans;
for (int j = 0; j < 10; j++)
{
if (j >= 1) n -= (long)Math.Pow(10, i);
if (n / a * b + (n - n / a) >= c)
{
ans = n;
}
}
}
if (ans == 999999999999999999 && ans / a * b + (ans - ans / a) < c)
{
ans = 1000000000000000000;
}
Console.WriteLine(ans);
}
}
}
No