結果

問題 No.3028 No.9999
ユーザー t98slider
提出日時 2025-02-21 21:53:24
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 1,144 ms / 4,000 ms
コード長 398 bytes
コンパイル時間 1,933 ms
コンパイル使用メモリ 192,404 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2025-02-21 21:53:31
合計ジャッジ時間 5,903 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin >> n;
    int v = 1;
    if(n == 1){
    	cout << 1 << '\n';
    	return 0;
    }
    for(int i = 1; i <= 3000000000ll; i++){
        v *= 10;
        v %= n;
        if(v == 1){
            cout << i << '\n';
            return 0;
        }
    }
}
0