結果

問題 No.1469 programing
ユーザー scrappyscrappy
提出日時 2022-10-21 10:33:39
言語 Go
(1.22.1)
結果
AC  
実行時間 11 ms / 3,000 ms
コード長 392 bytes
コンパイル時間 11,512 ms
コンパイル使用メモリ 212,228 KB
実行使用メモリ 9,656 KB
最終ジャッジ日時 2023-09-13 12:42:28
合計ジャッジ時間 12,533 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

package main

import (
	"bufio"
	"os"
)

func main() {
	rbuf := make([]byte, 5_000_000+2)
	wbuf := make([]byte, 5_000_000+2)

	rlen, _ := os.Stdin.Read(rbuf[:])

	last := byte(' ')

	wlen := 0
	for _, b := range rbuf[:rlen] {
		if last != b {
			wbuf[wlen] = b
			wlen++
		}
		last = b

		if b == '\n' {
			break
		}
	}

	wr := bufio.NewWriter(os.Stdout)
	wr.Write(wbuf[:wlen])
	wr.Flush()
}
0