Codeforces / polygon-issue-tracking

polygon-issue-tracking
16 stars 2 forks source link

Unable to use a generator in Go #471

Closed alex65536 closed 1 year ago

alex65536 commented 2 years ago

Create a task and add a generator written in Go (for example, this one):

package main

import (
    "fmt"
)

func main() {
    fmt.Println(2)
    fmt.Println(1, 1)
}

Then, invoke the generator from the script and run an invocation. The validator will fail with the following error:

Validator 'wfval.exe' returns exit code 3 [FAIL Expected EOLN (stdin, line 1)]

I suspect that the error has something to do with line ending styles, but I don't know how to fix it. Is there a way to write a generator in Go?

MikeMirzayanov commented 1 year ago

It seems Go doesn't support switching between \n and \r\n automatically. Probably, you need to write some wrapper code.