Last active
December 2, 2022 15:43
-
-
Save nakamkaz/fb25d92b3b0d8bf30efff57bdb7bd4b3 to your computer and use it in GitHub Desktop.
atcoder main template .go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
/* | |
A B | |
C D | |
E F | |
... | |
*/ | |
import ( | |
"bufio" | |
"fmt" | |
"log" | |
"os" | |
//"strconv" | |
"strings" | |
) | |
func dlog(msg ...interface{}) { | |
if os.Getenv("DEBUG") == "1" { | |
log.Print(msg) | |
} | |
} | |
func main() { | |
var score int = 0 | |
stdin := bufio.NewScanner(os.Stdin) | |
for stdin.Scan() { | |
line := stdin.Text() | |
lv := strings.Split(line," ") | |
fa,fb := lv[0],lv[1] | |
dlog(fa,fb) | |
} | |
fmt.Println(score) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
/** | |
line1 | |
line2 | |
line3 | |
... | |
*/ | |
import ( | |
"bufio" | |
"fmt" | |
"log" | |
"os" | |
"strconv" | |
) | |
func dout(msg ...interface{}) { | |
if os.Getenv("DEBUG") == "1" { | |
log.Print(msg) | |
} | |
} | |
func main() { | |
stdin := bufio.NewScanner(os.Stdin) | |
for stdin.Scan() { | |
line := stdin.Text() | |
lv, _ := strconv.Atoi(line) | |
fmt.Print("line: ", line) | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
/* bite just 1 huge line as a string */ | |
import ( | |
"fmt" | |
// "strings" | |
) | |
func main() { | |
var s string | |
fmt.Scan(&s) | |
fmt.Println(s) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
/* | |
N | |
a1 a2 a3 ... aN | |
*/ | |
import ( | |
"bufio" | |
// "fmt" | |
"os" | |
"strconv" | |
"strings" | |
) | |
func main() { | |
stdin := bufio.NewScanner(os.Stdin) | |
stdin.Scan() | |
n,_ := strconv.Atoi(stdin.Text()) | |
stdin.Scan() | |
line := strings.Split(stdin.Text()," ") | |
if n == len(line){ | |
is := make([]int,len(line)) | |
for i,v := range line { | |
t,_ := strconv.Atoi(v) | |
is[i]=t | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
/* | |
N A B | |
*/ | |
import ( | |
"bufio" | |
// "fmt" | |
// "log" | |
"os" | |
"strconv" | |
"strings" | |
) | |
func main() { | |
stdin := bufio.NewScanner(os.Stdin) | |
stdin.Scan() | |
line := strings.Split(stdin.Text(), " ") | |
n, _ := strconv.Atoi(line[0]) | |
a, _ := strconv.Atoi(line[1]) | |
b, _ := strconv.Atoi(line[2]) | |
_,_,_=n,a,b | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
/* | |
N | |
a1 | |
a2 | |
a3 | |
... | |
aN | |
*/ | |
import ( | |
"bufio" | |
"fmt" | |
"os" | |
"strconv" | |
// "strings" | |
// "sort" | |
) | |
func main() { | |
stdin := bufio.NewScanner(os.Stdin) | |
stdin.Scan() | |
n, _ := strconv.Atoi(stdin.Text()) | |
is := make([]int, n) | |
for i := 0; i <= n-1; i++ { | |
stdin.Scan() | |
is[i], _ = strconv.Atoi(stdin.Text()) | |
} | |
kmap := make(map[int]bool) | |
for _, v := range is { | |
kmap[v] = true | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
/* | |
aaa | |
*/ | |
import ( | |
"bufio" | |
// "fmt" | |
"os" | |
) | |
func main() { | |
stdin := bufio.NewScanner(os.Stdin) | |
stdin.Scan() | |
a := stdin.Text() | |
_ = a | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment