結果
| 問題 |
No.3110 Like CPCTF?
|
| コンテスト | |
| ユーザー |
lumc_
|
| 提出日時 | 2025-04-19 00:28:18 |
| 言語 | Rust (1.83.0 + proconio) |
| 結果 |
AC
|
| 実行時間 | 19 ms / 2,000 ms |
| コード長 | 995 bytes |
| コンパイル時間 | 13,023 ms |
| コンパイル使用メモリ | 396,704 KB |
| 実行使用メモリ | 7,844 KB |
| 最終ジャッジ日時 | 2025-04-19 00:28:37 |
| 合計ジャッジ時間 | 14,147 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 16 |
ソースコード
#![allow(
dead_code,
non_snake_case,
unused_imports,
unused_mut,
unused_variables,
while_true,
unused_assignments,
clippy::needless_range_loop,
clippy::ptr_arg,
clippy::type_complexity,
clippy::unnecessary_cast
)]
use proconio::{
input,
marker::{Chars, Usize1 as usize1},
};
use std::collections::{BinaryHeap, HashMap, HashSet, VecDeque};
fn main() {
input! { N: usize, S: Chars };
let mut ans = 0;
for i0 in 0..N {
for i1 in i0 + 1..N {
for i2 in i1 + 1..N {
for i3 in i2 + 1..N {
for i4 in i3 + 1..N {
let T = [S[i0], S[i1], S[i2], S[i3], S[i4]];
let cc = HashSet::<char>::from_iter(T.iter().cloned()).len();
if cc == 4 && T[0] == T[2] {
ans += 1;
}
}
}
}
}
}
println!("{}", ans);
}
lumc_