由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - 今天topcoder上一道漂亮的题目
相关主题
说说topcoder,acm训练和大公司面试的差别在哪里吧Java 问题,请教如何找出一个array里的duplicate segments? (转载)
Google面试问题问个google面试题
贡献一道M的链表题leetcode中那道Set Matrix Zeroes怎么做
做个题吧。decoder.Set Matrix Zeroes const space solution
谷歌还没开始HC,先team match 求捞问一个算法题
做topcoder竞赛的同学,欢迎加入Topcodes俱乐部面试会考A*算法么?
问一道精华帖的老题Facebook否认首次来华:年薪20万+绿卡不靠谱
问个C的基本问题这里的人搞编程竞赛的多吗?
相关话题的讨论汇总
话题: each话题: matches话题: 160话题: exactly话题: horizontal
进入JobHunting版参与讨论
1 (共1页)
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
3
DFS 加上剪枝?
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

1 (共1页)
进入JobHunting版参与讨论
相关主题
这里的人搞编程竞赛的多吗?谷歌还没开始HC,先team match 求捞
codility的两道题做topcoder竞赛的同学,欢迎加入Topcodes俱乐部
本科,G給95k是不是low ball了?问一道精华帖的老题
some leetcode issues are HARD, how do you smart guys figur问个C的基本问题
说说topcoder,acm训练和大公司面试的差别在哪里吧Java 问题,请教如何找出一个array里的duplicate segments? (转载)
Google面试问题问个google面试题
贡献一道M的链表题leetcode中那道Set Matrix Zeroes怎么做
做个题吧。decoder.Set Matrix Zeroes const space solution
相关话题的讨论汇总
话题: each话题: matches话题: 160话题: exactly话题: horizontal