結果

問題 No.8116 TCP ソート
ユーザー natu7925s
提出日時 2025-06-12 16:10:18
言語 Rust
(1.83.0 + proconio)
結果
WA  
実行時間 -
コード長 459 bytes
コンパイル時間 14,395 ms
コンパイル使用メモリ 398,484 KB
実行使用メモリ 7,848 KB
最終ジャッジ日時 2025-06-12 16:10:36
合計ジャッジ時間 15,111 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 11 WA * 16
権限があれば一括ダウンロードができます
コンパイルメッセージ
warning: value assigned to `c` is never read
 --> src/main.rs:9:13
  |
9 |     let mut c = 0;
  |             ^
  |
  = help: maybe it is overwritten before being read?
  = note: `#[warn(unused_assignments)]` on by default

ソースコード

diff #

use proconio::input;

fn main() {
    input! {
        s: String,
    }

    let mut ans = String::new();
    let mut c = 0;

    c = s.chars().filter(|&c| c == 'T').count() as i32;
    for _ in 0..c {
        ans += "T";
    }
    c = s.chars().filter(|&c| c == 'C').count() as i32;
    for _ in 0..c {
        ans += "C";
    }
    c = s.chars().filter(|&c| c == 'P').count() as i32;
    for _ in 0..c {
        ans += "P";
    }

    println!("{}", ans);
}
0