Submission #2667704
Source Code Expand
/// // File: c.go // Author: ymiyamoto // // Created on Wed Jun 13 23:37:46 2018 // package main import ( "fmt" "sort" ) var W, H int64 var p, q []int func main() { fmt.Scan(&W, &H) n := int64(W+1)*int64(H+1) - 1 p = make([]int, W) q = make([]int, H) for i := range p { fmt.Scan(&p[i]) } sort.Ints(p) for i := range q { fmt.Scan(&q[i]) } sort.Ints(q) ans := int64(0) var h, w int64 for n > 0 { if w < int64(len(p)) && p[w] < q[h] { ans += int64(H+1-h) * int64(p[w]) n -= H + 1 - h w++ } else { ans += int64(W+1-w) * int64(q[h]) n -= W + 1 - w h++ } } fmt.Println(ans) }
Submission Info
Submission Time | |
---|---|
Task | C - Gr-idian MST |
User | mohei |
Language | Go (1.6) |
Score | 0 |
Code Size | 675 Byte |
Status | RE |
Exec Time | 1300 ms |
Memory | 5504 KB |
Judge Result
Set Name | Sample | All | ||||||
---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 500 | ||||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | s1.txt, s2.txt |
All | 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, 11.txt, 12.txt, 13.txt, 14.txt, 15.txt, 16.txt, 17.txt, 18.txt, 19.txt, 20.txt, 21.txt, 22.txt, 23.txt, 24.txt, 25.txt, 26.txt, 27.txt, 28.txt, s1.txt, s2.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
01.txt | AC | 1264 ms | 5504 KB |
02.txt | AC | 1264 ms | 5376 KB |
03.txt | RE | 1265 ms | 5504 KB |
04.txt | RE | 1280 ms | 5504 KB |
05.txt | AC | 1263 ms | 5504 KB |
06.txt | AC | 1262 ms | 5504 KB |
07.txt | AC | 1267 ms | 5504 KB |
08.txt | AC | 1262 ms | 5504 KB |
09.txt | AC | 1281 ms | 5504 KB |
10.txt | AC | 1263 ms | 5504 KB |
11.txt | AC | 1260 ms | 5376 KB |
12.txt | RE | 1248 ms | 5504 KB |
13.txt | RE | 1259 ms | 5504 KB |
14.txt | AC | 1270 ms | 5504 KB |
15.txt | RE | 1282 ms | 5376 KB |
16.txt | AC | 634 ms | 5376 KB |
17.txt | RE | 636 ms | 5376 KB |
18.txt | AC | 633 ms | 5504 KB |
19.txt | RE | 633 ms | 5504 KB |
20.txt | RE | 428 ms | 5376 KB |
21.txt | AC | 853 ms | 5504 KB |
22.txt | RE | 853 ms | 5504 KB |
23.txt | RE | 896 ms | 5504 KB |
24.txt | RE | 1300 ms | 5504 KB |
25.txt | AC | 1 ms | 512 KB |
26.txt | RE | 3 ms | 512 KB |
27.txt | RE | 3 ms | 512 KB |
28.txt | RE | 3 ms | 512 KB |
s1.txt | AC | 1 ms | 512 KB |
s2.txt | AC | 1 ms | 512 KB |