m*****f 发帖数: 1243 | 1 Problem Statement
You have a piece of paper with exactly D positions laid out in a horizontal
row. Each position looks like the following:
_
|_|
|_|
There are 7 line segments in each position, and each line segment can hold
exactly one match. Matches cannot be placed anywhere except on the line
segments. You are given an integer N containing exactly D digits (with no
leading zeroes). Spell out the number using matches on the paper. Each digit
must occupy a single positio |
p*********w 发帖数: 23432 | 2 有趣
horizontal
【在 m*****f 的大作中提到】 : Problem Statement : : You have a piece of paper with exactly D positions laid out in a horizontal : row. Each position looks like the following: : _ : |_| : |_| : There are 7 line segments in each position, and each line segment can hold : exactly one match. Matches cannot be placed anywhere except on the line : segments. You are given an integer N containing exactly D digits (with no
|
a****n 发帖数: 1887 | |
g*******y 发帖数: 1930 | 4 state: A[i][j][k]
1<=i<=D: A[i]: subproblem from 1th digit to ith digit
-7D<= j <= 7D: you can add/remove j matches
0<= k <= K: the number of moves you've made
value of A[i][j][k] = number of distinct integers
result: sum of A[D][0][所有k]
对ith digit, 它有可能转变到其他的9个(加自身10个)数字 by move x matches +
add/remove y matches
加一个10*10的matrix记录任意两个数字之间的变化
这样就有状态方程了 |
g*******y 发帖数: 1930 | 5 查了下是DivI 500分的题啊
不过我觉得面试一般不会出topcoder那类的题目。。。虽然那些题可以拿来练算法和coding
horizontal
【在 m*****f 的大作中提到】 : Problem Statement : : You have a piece of paper with exactly D positions laid out in a horizontal : row. Each position looks like the following: : _ : |_| : |_| : There are 7 line segments in each position, and each line segment can hold : exactly one match. Matches cannot be placed anywhere except on the line : segments. You are given an integer N containing exactly D digits (with no
|
m*****f 发帖数: 1243 | 6 是啊, 怎么啦?
【在 g*******y 的大作中提到】 : 查了下是DivI 500分的题啊 : 不过我觉得面试一般不会出topcoder那类的题目。。。虽然那些题可以拿来练算法和coding : : horizontal
|
l***i 发帖数: 632 | 7 貌似有一年中国NOI考试考题就是移火柴...
horizontal
【在 m*****f 的大作中提到】 : Problem Statement : : You have a piece of paper with exactly D positions laid out in a horizontal : row. Each position looks like the following: : _ : |_| : |_| : There are 7 line segments in each position, and each line segment can hold : exactly one match. Matches cannot be placed anywhere except on the line : segments. You are given an integer N containing exactly D digits (with no
|
g*******y 发帖数: 1930 | 8 呵呵,就是感觉我的DP解法跟这个题的难度还是蛮匹配的。。。
刚刚看了别人的code,确实是DP解法
【在 m*****f 的大作中提到】 : 是啊, 怎么啦?
|
k***e 发帖数: 556 | 9 题目太长了 看不下去啊
horizontal
【在 m*****f 的大作中提到】 : Problem Statement : : You have a piece of paper with exactly D positions laid out in a horizontal : row. Each position looks like the following: : _ : |_| : |_| : There are 7 line segments in each position, and each line segment can hold : exactly one match. Matches cannot be placed anywhere except on the line : segments. You are given an integer N containing exactly D digits (with no
|
g*******y 发帖数: 1930 | 10 呵呵,其实这个题算短的了。。。
【在 k***e 的大作中提到】 : 题目太长了 看不下去啊 : : horizontal
|