File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
copypasta/template/interactive_problem Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 9
9
// github.com/EndlessCheng/codeforces-go
10
10
type (
11
11
initData struct { n int }
12
- request struct { i int }
12
+ request struct { q [] int }
13
13
response struct { v int }
14
14
answer struct { ans []int }
15
15
)
@@ -31,8 +31,13 @@ func (io io) readInitData() (d initData) {
31
31
}
32
32
33
33
func (io io ) query (q request ) (resp response ) {
34
- Fprintln (io .out , "?" , q .i )
34
+ Fprint (io .out , "?" )
35
+ for _ , v := range q .q {
36
+ Fprint (io .out , " " , v )
37
+ }
38
+ Fprintln (io .out )
35
39
io .out .Flush ()
40
+
36
41
Fscan (io .in , & resp .v )
37
42
if resp .v < 0 {
38
43
panic (- 1 )
@@ -57,7 +62,7 @@ func (io io) printAnswer(a answer) {
57
62
}
58
63
59
64
func doInteraction (it interaction ) {
60
- q := func (i int ) int { return it .query (request {i }).v }
65
+ q := func (q ... int ) int { return it .query (request {q }).v }
61
66
dt := it .readInitData ()
62
67
n := dt .n
63
68
ans := make ([]int , n ) //
You can’t perform that action at this time.
0 commit comments