Skip to content

Commit f03ecbb

Browse files
author
shixi_chenzhang
committed
Codejam to I/O for Women 2017
1 parent d53ebc4 commit f03ecbb

File tree

5 files changed

+55
-0
lines changed

5 files changed

+55
-0
lines changed

IO for Women/2017/A.java

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
import java.io.PrintStream;
22
import java.util.*;
33

4+
/**
5+
* Codejam to I/O for Women 2017 Problem A: Ticket Trouble
6+
* Check README.md for explanation.
7+
*/
48
public class Main {
59

610
private String solve(Scanner scanner) {

IO for Women/2017/B.java

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
import java.io.PrintStream;
22
import java.util.*;
33

4+
/**
5+
* Codejam to I/O for Women 2017 Problem B: Understudies
6+
* Check README.md for explanation.
7+
*/
48
public class Main {
59

610
private String solve(Scanner scanner) {

IO for Women/2017/C.java

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
import java.io.PrintStream;
22
import java.util.*;
33

4+
/**
5+
* Codejam to I/O for Women 2017 Problem C: Word Search
6+
* Check README.md for explanation.
7+
*/
48
public class Main {
59

610
private String solve(Scanner scanner) {

IO for Women/2017/D.java

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
import java.io.PrintStream;
22
import java.util.*;
33

4+
/**
5+
* Codejam to I/O for Women 2017 Problem D: Where Ya Gonna Call?
6+
* Check README.md for explanation.
7+
*/
48
public class Main {
59

610
private String solve(Scanner scanner) {

IO for Women/2017/README.md

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Codejam to I/O for Women 2017
2+
https://code.google.com/codejam/contest/12224486/dashboard
3+
4+
## Problem A: Ticket Trouble
5+
6+
Simple. For each row, greedy to get the maximum number.
7+
8+
## Problem B: Understudies
9+
10+
Sort all probabilities. Then match the smallest one with the biggest one.
11+
12+
## Problem C: Word Search
13+
14+
Not so simple.
15+
Just consider of this pattern:
16+
```
17+
IIIIIIIIIIIIII
18+
//////////////
19+
OOOOOOOOOOOOOO
20+
//////////////
21+
IIIIIIIIIIIIII
22+
...
23+
```
24+
For each `/` on border, it will create 1 `I/O`.
25+
For each `/` in middle, it will create 3 `I/O`.
26+
27+
## Problem D: Where Ya Gonna Call?
28+
29+
This problem is hard, very hard, maybe the hardest problem in Codejam to I/O for Women.
30+
Using Floyd algorithm to calculate distance between any nodes.
31+
Then, for each edge, for each possible position, check the minimax.
32+
The problem is, what's the possible position?
33+
34+
Assume the verticals of the edge is `u, v` and its length is `l`.
35+
Assume the distance between u and any point is `a[]`, distance
36+
between v and any point is `b[]`.
37+
Then, all possible positions x should satisfies `a[i]+x = b[j]+(l-x)`.
38+
So, just iterate i and j, to calculate all possible x, and find the minimax.
39+

0 commit comments

Comments
 (0)