結果
| 問題 | No.395 永遠の17歳 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-10-15 01:37:17 |
| 言語 | Rust (1.99.0 + proconio + num + itertools + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 1 ms / 1,000 ms |
| + 7µs | |
| コード長 | 494 bytes |
| 記録 | |
| コンパイル時間 | 544 ms |
| コンパイル使用メモリ | 179,844 KB |
| 実行使用メモリ | 9,872 KB |
| 最終ジャッジ日時 | 2026-10-15 01:37:21 |
| 合計ジャッジ時間 | 2,729 ms |
|
ジャッジサーバーID (参考情報) |
judge4_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 18 |
コンパイルメッセージ
warning: unused import: `std::collections::HashMap`
--> src/main.rs:2:5
|
2 | use std::collections::HashMap;
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default
warning: unused import: `std::collections::BTreeSet`
--> src/main.rs:3:5
|
3 | use std::collections::BTreeSet;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused import: `std::ops::ControlFlow::Break`
--> src/main.rs:4:5
|
4 | use std::ops::ControlFlow::Break;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unnecessary parentheses around `for` iterator expression
--> src/main.rs:10:14
|
10 | for i in (8..100){
| ^ ^
|
= note: `#[warn(unused_parens)]` (part of `#[warn(unused)]`) on by default
help: remove these parentheses
|
10 - for i in (8..100){
10 + for i in 8..100 {
|
ソースコード
use proconio::input;
use std::collections::HashMap;
use std::collections::BTreeSet;
use std::ops::ControlFlow::Break;
fn main(){
input!{
n:isize,
}
let mut ans=-1;
for i in (8..100){
let mut c=0;
let mut d=1;
let mut f=n;
while f>0{
if f%i>=10{
c=100;
break;
}
c+=d*(f%i);f/=i;d*=10;
}
if c==17{
ans=i;break;
}
}
print!("{}",ans);
}