Submission #12935427


Source Code Expand

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

func main() {
	nextReader = newScanner()
	x := nextInt()
	fmt.Println((x / 500 * 1000) + (x % 500 / 5 * 5))
}

// ---------------------------------------------------------------
// I/O
// ---------------------------------------------------------------
var nextReader func() string

func newScanner() func() string {
	sc := bufio.NewScanner(os.Stdin)
	sc.Buffer(make([]byte, 1024), int(1e11))
	sc.Split(bufio.ScanWords)
	return func() string {
		sc.Scan()
		return sc.Text()
	}
}

func nextString() string { return nextReader() }

func nextInt() int { n, _ := strconv.Atoi(nextReader()); return n }

func nextInts(size int) []int {
	ns := make([]int, size)
	for i := 0; i < size; i++ {
		ns[i] = nextInt()
	}
	return ns
}

Submission Info

Submission Time
Task B - Golden Coins
User hidapple
Language Go (1.6)
Score 200
Code Size 821 Byte
Status AC
Exec Time 1 ms
Memory 640 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 3
AC × 14
Set Name Test Cases
Sample sample_01, sample_02, sample_03
All hand_01, hand_02, hand_03, hand_04, hand_05, random_01, random_02, random_03, random_04, random_05, random_06, sample_01, sample_02, sample_03
Case Name Status Exec Time Memory
hand_01 AC 1 ms 640 KiB
hand_02 AC 1 ms 640 KiB
hand_03 AC 1 ms 640 KiB
hand_04 AC 1 ms 640 KiB
hand_05 AC 1 ms 640 KiB
random_01 AC 1 ms 640 KiB
random_02 AC 1 ms 640 KiB
random_03 AC 1 ms 640 KiB
random_04 AC 1 ms 640 KiB
random_05 AC 1 ms 640 KiB
random_06 AC 1 ms 640 KiB
sample_01 AC 1 ms 640 KiB
sample_02 AC 1 ms 640 KiB
sample_03 AC 1 ms 640 KiB