結果

問題 No.3028 No.9999
ユーザー sai
提出日時 2025-02-22 05:14:28
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 1,525 ms / 4,000 ms
コード長 347 bytes
コンパイル時間 3,010 ms
コンパイル使用メモリ 274,220 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2025-02-22 05:14:36
合計ジャッジ時間 8,015 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

int main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  int N; std::cin >> N;
  if (N == 1) {
    std::cout << "1\n";
    return 0;
  }
  long long r = 1;
  for (int k = 1; k <= N; k++) {
    r = r * 10 % N;
    if (r == 1) {
      std::cout << k << '\n';
      return 0;
    }
  }
  assert(false);
}
0