結果
| 問題 |
No.3028 No.9999
|
| コンテスト | |
| ユーザー |
tnakao0123
|
| 提出日時 | 2025-02-23 16:03:24 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 1,147 ms / 4,000 ms |
| コード長 | 354 bytes |
| コンパイル時間 | 448 ms |
| コンパイル使用メモリ | 40,064 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2025-02-23 16:03:29 |
| 合計ジャッジ時間 | 4,789 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 23 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:15:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
15 | scanf("%d", &n);
| ~~~~~^~~~~~~~~~
ソースコード
/* -*- coding: utf-8 -*-
*
* 3028.cc: No.3028 No.9999 - yukicoder
*/
#include<cstdio>
#include<algorithm>
using namespace std;
/* main */
int main() {
int n;
scanf("%d", &n);
if (n == 1) { puts("1"); return 0; }
for (int k = 1, t = 1; k <= n; k++) {
t = t * 10 % n;
if (t == 1) { printf("%d\n", k); break; }
}
return 0;
}
tnakao0123