結果

問題 No.18 うーさー暗号
ユーザー fmhrfmhr
提出日時 2015-05-23 06:56:03
言語 Go
(1.21.3)
結果
AC  
実行時間 3 ms / 5,000 ms
コード長 474 bytes
コンパイル時間 10,419 ms
コンパイル使用メモリ 207,540 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-21 11:47:28
合計ジャッジ時間 11,175 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 2 ms
4,376 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 1 ms
4,380 KB
testcase_11 AC 1 ms
4,376 KB
testcase_12 AC 3 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package main

import (
	"fmt"
	"strings"
)

func main() {
	var alp, S string
	alp = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
	fmt.Scan(&S)
	s := strings.Split(S, "")
	alp_s := strings.Split(alp, "")
	//fmt.Println(alp_s)
	//fmt.Println(bytes.IndexByte(alp_s, "F"))
	//fmt.Println(strings.Index(alp, "F"))
	//fmt.Println(alp_s)
	//fmt.Println(s)
	for i := 0; i < len(s); i++ {
		s[i] = alp_s[(strings.Index(alp, s[i])-i+1039)%26]
	}
	//fmt.Println(s)
	fmt.Println(strings.Join(s, ""))
}
0