結果

問題 No.3028 No.9999
ユーザー bal4u
提出日時 2025-03-04 19:35:10
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 1,144 ms / 4,000 ms
コード長 291 bytes
コンパイル時間 2,444 ms
コンパイル使用メモリ 192,508 KB
実行使用メモリ 8,608 KB
最終ジャッジ日時 2025-03-04 19:35:17
合計ジャッジ時間 6,352 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main(){
    int n;
    cin >> n;

    if(n == 1){
        cout << 1 << endl;
        return 0;
    }

    int k = 1;
    int r = 10 % n;
    while(r != 1){
        r = (r * 10) % n;
        k++;
    }
    cout << k << endl;
    return 0;
}
0