結果
| 問題 | No.252 "良問"(良問とは言っていない (2) |
| コンテスト | |
| ユーザー |
fmhr
|
| 提出日時 | 2015-07-25 19:23:22 |
| 言語 | Go (1.23.4) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 1,329 bytes |
| コンパイル時間 | 11,380 ms |
| コンパイル使用メモリ | 225,108 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-10-10 19:27:23 |
| 合計ジャッジ時間 | 12,128 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | RE * 7 |
ソースコード
package main
import (
"bufio"
"fmt"
"os"
"strconv"
)
func main() {
var a int
a = nextInt()
for i := 0; i < a; i++ {
solve()
}
}
func solve() {
//fmt.Println("---")
var s string
s = next()
s_len := len(s)
cost := 100 + s_len
// p_cost := 0
// // "problem"のdiff()を計算しておく
// diff_p := make([]int, s_len)
// for j:=0; j<s_len-6; j++{
// diff_p[j] = diff(s[j:j+7], "problem")
// }
//
// for j := 0; j < s_len; j++ {
// if j >= 7 {
// if s[j-7:j] == "problem" {
// p_cost++
// }
// }
// for k := j + 4; k < s_len-6; k++ {
// cost = min(cost, diff(s[j:j+4], "good")+diff_p[k]+p_cost)
// }
// //fmt.Print(cost, " ")
// }
fmt.Println(cost)
}
func min(x, y int) int {
if x > y {
x = y
}
return x
}
func diff(s1, s2 string) int {
c := 0
for i := 0; i < len(s1); i++ {
if s1[i] != s2[i] {
c++
}
}
return c
}
var s = bufio.NewScanner(os.Stdin)
func next() string {
s.Split(bufio.ScanWords)
s.Scan()
return s.Text()
}
func nextInt() int {
i, e := strconv.Atoi(next())
if e != nil {
panic(e)
}
return i
}
var rdr = bufio.NewReaderSize(os.Stdin, 10000000000)
func readLine() string {
buf := make([]byte, 0, 10000000000)
for {
l, p, e := rdr.ReadLine()
if e != nil {
panic(e)
}
buf = append(buf, l...)
if !p {
break
}
}
return string(buf)
}
fmhr