結果
| 問題 | 
                            No.501 穴と文字列
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2020-08-06 12:01:31 | 
| 言語 | Go  (1.23.4)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 927 bytes | 
| コンパイル時間 | 9,158 ms | 
| コンパイル使用メモリ | 238,332 KB | 
| 実行使用メモリ | 5,376 KB | 
| 最終ジャッジ日時 | 2024-09-19 12:22:22 | 
| 合計ジャッジ時間 | 10,265 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge3 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | WA * 22 | 
ソースコード
package main
import (
	"bufio"
	"os"
	"strconv"
	"strings"
)
var sc = bufio.NewScanner(os.Stdin)
func NextLine() string {
	sc.Scan()
	return sc.Text()
}
func NextInt() int {
	a, _ := strconv.Atoi(NextLine())
	return a
}
/**
 * スペース区切りで文字列を受け取って整数を2個返す
 */
func GetTwoInts() (a int, b int) {
	str := strings.Split(NextLine(), " ")
	a, _ = strconv.Atoi(str[0])
	b, _ = strconv.Atoi(str[1])
	return
}
func main() {
	N, D := GetTwoInts()
	sToAABBCC(N, D)
}
/**
 * 文字列
 */
func sToAABBCC(N int, D int)  {
	//result = ""
	//appender := "A"
	//最後の桁が2か1か0になれば良い
	//効率化の手段として残り桁数が3のとき残り数値が3ならAで埋めれば良い、残り数値が6ならBで埋めれば良い
	for i:=0; i< N; i++ {
		if D == 2 * (N - i){
			print("B")
		}else if D == 0 {
			//appender = "C"
			print("C")
		}
		D--
		print("A")
	}
}