結果
| 問題 |
No.1047 Zero (Novice)
|
| コンテスト | |
| ユーザー |
mizni
|
| 提出日時 | 2020-05-08 22:49:22 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 290 bytes |
| コンパイル時間 | 2,402 ms |
| コンパイル使用メモリ | 190,648 KB |
| 最終ジャッジ日時 | 2025-01-10 09:07:24 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 7 TLE * 10 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main() {
long long int a, b, n = 0, ans = 0;
cin >> a >> b;
if (a > 0 && b > 0) {
cout << "-1"
<< "\n";
return 0;
}
do {
int x = n;
n = a * n + b;
ans++;
} while (n != 0);
cout << ans << "\n";
}
mizni