結果

問題 No.1047 Zero (Novice)
ユーザー keisuke6
提出日時 2022-11-01 21:02:27
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 255 bytes
コンパイル時間 1,810 ms
コンパイル使用メモリ 192,348 KB
最終ジャッジ日時 2025-02-08 16:46:43
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 16 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
  int A,B;
  cin>>A>>B;
  int N = 0;
  for(int i=1;i<=1e9;i++){
      N = A*N+B;
      if(!N){
          cout<<i<<endl;
          return 0;
      }
  }
  cout<<-1<<endl;
}
0