結果
| 問題 |
No.604 誕生日のお小遣い
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-12-16 04:42:46 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 381 bytes |
| コンパイル時間 | 472 ms |
| コンパイル使用メモリ | 53,768 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-12-14 17:06:37 |
| 合計ジャッジ時間 | 2,055 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 3 |
| other | AC * 3 WA * 12 RE * 6 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:6:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
6 | scanf("%lld%lld%lld",&A,&B,&C);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <iostream>
using namespace std;
int main(void){
long long A,B,C;
scanf("%lld%lld%lld",&A,&B,&C);
long long remain,block;
block = A * C / (A + B - 1);
remain = C % block;
if(A > remain)
{
cout << block + remain;
}
else
{
cout << block + A;
}
}