一道OJ的题 程序超时怎么解决,求大神指导.

诸葛阿黑传2022-10-04 11:39:541条回答

一道OJ的题 程序超时怎么解决,求大神指导.
Problem 1036 - Cards
Time Limit: 1000MS Memory Limit: 65536KB Difficulty: 3
Total Submit: 1315 Accepted: 374 Special Judge: No
Description
Magicpig and Kinfkong come to like playing cards recently. Magicpig knows that Kinfkong is very good at mathematics, so he often asks Kinfkong
some very hard problems in order to baffle him. You know, Kinfkong is very clever, so he can defeat Magicpig each time.
One day, Magicpig takes out a pile of n cards and asks Kinfkong a question: "Now I have n cards in my hand. We do't care about the face value
of the cards, so we consider them to be the same. Now you can take some cards from my hand. Each time you can take 1,2 or 3 cards.
Repeat this step until there is no more card in my hand. Now I want to know how many different ways can you take away all the cards
from my hand. I give you 10 minutes. If you can't figure out the answer, you are defeated."
You are a friend of Kinfkong. Now Kinfkong can not figure out the answer and there is no time left! He knows you are an excellent ACMer, so he
needs you help!
Input
The input contains one or more data sets. Each data set consists of a positive integer n(

已提交,审核后显示!提交回复

共1条回复
huashanrenjian 共回答了16个问题 | 采纳率87.5%
我就想问一下你提交的时候把system("pause");删除了没有?
如果没删除,的确会出现RE的情况
其他的我还没来得及看
1年前

相关推荐