https://codeforces.com/problemset/problem/1293/C https://codeforces.com/contest/1353/problem/A https://codeforces.com/gym/102253/problem/C
(urlStr string)
| 34 | // https://codeforces.com/contest/1353/problem/A |
| 35 | // https://codeforces.com/gym/102253/problem/C |
| 36 | func parseCodeforcesProblemURL(urlStr string) (contestID, problemID string, isGYM bool) { |
| 37 | sp := strings.Split(urlStr, "/") |
| 38 | switch { |
| 39 | case strings.Contains(urlStr, "/problemset/problem/"): |
| 40 | return sp[len(sp)-2], sp[len(sp)-1], false |
| 41 | case strings.Contains(urlStr, "/contest/"): |
| 42 | return sp[len(sp)-3], sp[len(sp)-1], false |
| 43 | case strings.Contains(urlStr, "/gym/"): |
| 44 | return sp[len(sp)-3], sp[len(sp)-1], true |
| 45 | default: |
| 46 | panic("invalid URL") |
| 47 | } |
| 48 | } |
| 49 | |
| 50 | func genDirName(contestID string) string { |
| 51 | cid, err := strconv.Atoi(contestID) |
no outgoing calls
no test coverage detected