結果
問題 | No.1735 C# |
ユーザー |
|
提出日時 | 2022-03-01 17:51:49 |
言語 | Rust (1.83.0 + proconio) |
結果 |
AC
|
実行時間 | 1 ms / 2,000 ms |
コード長 | 417 bytes |
コンパイル時間 | 11,810 ms |
コンパイル使用メモリ | 386,464 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-08 00:29:52 |
合計ジャッジ時間 | 12,711 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 7 |
ソースコード
const SCALE: [&str; 12] = ["C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "A#", "B",];fn read() -> usize {let mut buf = String::new();std::io::stdin().read_line(&mut buf).unwrap();let c = buf.trim();SCALE.iter().position(|&e| e == c).unwrap()}fn solve(sn: usize) -> &'static str {SCALE.iter().cycle().nth(sn + 1).unwrap()}fn main() {println!("{}", solve(read()));}