結果
問題 |
No.501 穴と文字列
|
ユーザー |
![]() |
提出日時 | 2025-02-12 18:58:59 |
言語 | Go (1.23.4) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 290 bytes |
コンパイル時間 | 12,569 ms |
コンパイル使用メモリ | 238,280 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2025-02-12 18:59:13 |
合計ジャッジ時間 | 12,387 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 22 |
ソースコード
package main import . "fmt" import . "strings" func main() { var n, d int Scan(&n, &d) for a := n; a >= 0; a-- { b := (d - a) / 2 if b < 0 || a + b > n || a+2*b != d { continue } c := n - (a+b) ans := Repeat("A",a)+Repeat("B",b)+Repeat("C",c) Println(ans) return } }