61阅读

the last of us-完形填空 One of the main reasons that may stop us from

发布时间:2017-07-30 所属栏目:end of the line

一 : 完形填空 One of the main reasons that may stop us from

完形填空
One of the main reasons that may stop us from reaching our goals and desires is our inability to be
flexible.
This fact may be_1_to swallow, but it's true.We do everything to get rid of suffering in our lives, yet
challenges and pressures can_2_the best in us.
If you have been burdened (负担)by__3__in the past, learn from them, forget about them, and
move on.Some people_4_to focus on how bad their lives have been_5_these mistakes.As a result, they
remain_6_in their miserable lives.
So what if you run a business and you lose a ton of money?In this_7_, some people would remain
deeply_8_for such a long time, and their personal lives are being affected_9_.If you're afraid to fail, then
you will_10_all your chances to achieve your goals in life._11_again;but this time, be more careful and
use your past mistakes as guide maps.
But when you try, make sure you_12_.I've met so many people who accepted my suggestion, but
most of them would_13_right in the middle of their work.They have the drive to start, _14_they lack the
motivation to go through all the_15_.Yes, this is another fact of life.Those who persist (坚持) may have
a bad time at present, but they shall have the_16_laugh.
Let's fast forward into the_17_.Let's say you did try, you followed through, and you succeeded.
Congratulations.So you became_18_by harvesting the fruits of your labor.This does not mean you'll stay
in that situation for good._19_may arise again, so always be ready to adjust to the present situation.The
only thing permanent in this world is_20_.
( ) 1. A. false
( ) 2. A. center on
( ) 3. A. mistakes
( ) 4. A. fail
( ) 5. A. except for
( ) 6. A. stuck
( ) 7. A. position
( ) 8. A. discouraged
( ) 9. A. slightly
( ) 10. A. catch
( ) 11. A. Finish
( ) 12. A. follow through
( ) 13. A. interrupt
( ) 14. A. for
( ) 15. A. reports
( ) 16. A. nervous
( ) 17. A. past
( ) 18. A. tired
( ) 19. A. Problems
( ) 20.A. success
B. hard
B. ruin
B. loads
B. intend
B. because of
B. satisfied
B. company
B. touched
B. negatively
B. risk
B. Lose
B. give up
B. stop
B. as
B. difficulties
B. short
B. future
B. grateful
B. Congratulations
B. laugh
C. able
C. bring out
C. debts
C. hate
C. as to
C. unknown
C. phenomenon
C. seated
C. immediately
C. take
C. Refuse
C. take off
C. divide
C. but
C. lives
C. small
C. labor
C. wealthy
C. Goals
C. love
D. impossible
D. exchange
D. reasons
D. tend
D. but for
D. interested
D. situation
D. scared
D. usually
D. increase
D. Try
D. end up
D. recover
D. though
D. papers
D. last
D. truth
D. generous
D. Chances
D. change
题型:完形填空难度:中档来源:安徽省同步题

1-5: BCADB 6-10: ADABB 11-15: DABCB 16-20: DBCAD


考点:

考点名称:日常生活类阅读

日常生活类阅读的概念:

日常生活这一话题主要涉及人们衣食住行等方面的活动。这一话题的选材主要针对人们日常的工作,生活以及学习情况。做这一类题时,最主要的是要把握好人物的活动内容,时间和地点。

日常生活类阅读题答题技巧:

【题型说明】
该类文章内容涉及到人们的言谈举止、生活习惯、饮食起居、服饰仪表、恋爱婚姻、消遣娱乐、节日起源、家庭生活等。文章篇幅短小,追根溯源,探索各项风俗的历史渊源,内容有趣。命题也以送分题为主,如事实细节题、语义转换题、词义猜测题和简单推理判断题等。虽然这类文章读起来感觉轻松,试题做起来比较顺手,但绝不能掉以轻心。因为稍不留神,就会丢分。   
【备考提醒】
为了保证较高准确率,建议同学们做好以下几点:   
1、保持正常的考试心态。笔者在教学中发现,越是容易的试题,同学们越是容易失分。为什么呢?因为在这种情况下,同学们极易产生麻痹思想,认为题目好做,就不引起高度重视,于是思维不发散、不周密。而命题人就是利用同学们的这一弱点,设计陷阱题。所以,无论试题难易与否,我们都要保持正常的考试心态。试题容易,不欣喜;试题难,不悲观。   
2、根据前面讲到的方法,认认真真、细细心心做好事实细节题。   
3、做好语义转换题。这类题是根据英语中一词多义和某些词语在文中能表达一定的修辞意义的原则而设计的。要求同学们解释某生词的含义,确定多义词或短语在文中的意思,确认文中的某个代词所指代的对象,或者对英语中特有的表达、格言、谚语进行解释。这种题要求同学们一定要根据上下文猜测词义或理解句子,切不可望文生义。   
4、做好简单推理判断题。简单推理判断题要以表面文字为前提,以具体事实为依据进行推理,做出判断。这种推理方式比较直接,只要弄清事实,即可结合常识推断出合理的结论。

二 : 试译:THE TRAIL OF THE MEAT

Chapter 1
THE TRAIL OF THE MEAT

Dark spruce forest frowned on either side the frozen waterway. The trees had been stripped by a recent wind of their white covering of frost, and they seemed to lean towards each other, black and ominous, in the fading light. A vast silence reigned over the land. The land itself was a desolation, lifeless, without movement, so lone and cold that the spirit of it was not even that of sadness. There was a hint in it of laughter, but of a laughter more terrible than any sadness - a laughter that was mirthless as the smile of the sphinx, a laughter cold as the frost and partaking of the grimness of infallibility. It was the masterful and incommunicable wisdom of eternity laughing at the futility of life and the effort of life. It was the Wild, the savage, frozen- hearted Northland Wild.
But there WAS life, abroad in the land and defiant. Down the frozen waterway toiled a string of wolfish dogs. Their bristly fur was rimed with frost. Their breath froze in the air as it left their mouths, spouting forth in spumes of vapour that settled upon the hair of their bodies and formed into crystals of frost. Leather harness was on the dogs, and leather traces attached them to a sled which dragged along behind. The sled was without runners. It was made of stout birch-bark, and its full surface rested on the snow. The front end of the sled was turned up, like a scroll, in order to force down and under the bore of soft snow that surged like a wave before it. On the sled, securely lashed, was a long and narrow oblong box. There were other things on the sled - blankets, an axe, and a coffee-pot and frying-pan; but prominent, occupying most of the space, was the long and narrow oblong box.
In advance of the dogs, on wide snowshoes, toiled a man. At the rear of the sled toiled a second man. On the sled, in the box, lay a third man whose toil was over, - a man whom the Wild had conquered and beaten down until he would never move nor struggle again. It is not the way of the Wild to like movement. Life is an offence to it, for life is movement; and the Wild aims always to destroy movement. It freezes the water to prevent it running to the sea; it drives the sap out of the trees till they are frozen to their mighty hearts; and most ferociously and terribly of all does the Wild harry and crush into submission man - man who is the most restless of life, ever in revolt against the dictum that all movement must in the end come to the cessation of movement.
But at front and rear, unawed and indomitable, toiled the two men who were not yet dead. Their bodies were covered with fur and soft-tanned leather. Eyelashes and cheeks and lips were so coated with the crystals from their frozen breath that their faces were not discernible. This gave them the seeming of ghostly masques, undertakers in a spectral world at the funeral of some ghost. But under it all they were men, penetrating the land of desolation and mockery and silence, puny adventurers bent on colossal adventure, pitting themselves against the might of a world as remote and alien and pulseless as the abysses of space.
They travelled on without speech, saving their breath for the work of their bodies. On every side was the silence, pressing upon them with a tangible presence. It affected their minds as the many atmospheres of deep water affect the body of the diver. It crushed them with the weight of unending vastness and unalterable decree. It crushed them into the remotest recesses of their own minds, pressing out of them, like juices from the grape, all the false ardours and exaltations and undue self-values of the human soul, until they perceived themselves finite and small, specks and motes, moving with weak cunning and little wisdom amidst the play and inter-play of the great blind elements and forces.
An hour went by, and a second hour. The pale light of the short sunless day was beginning to fade, when a faint far cry arose on the still air. It soared upward with a swift rush, till it reached its topmost note, where it persisted, palpitant and tense, and then slowly died away. It might have been a lost soul wailing, had it not been invested with a certain sad fierceness and hungry eagerness. The front man turned his head until his eyes met the eyes of the man behind. And then, across the narrow oblong box, each nodded to the other.
A second cry arose, piercing the silence with needle-like shrillness. Both men located the sound. It was to the rear, somewhere in the snow expanse they had just traversed. A third and answering cry arose, also to the rear and to the left of the second cry.
"They're after us, Bill," said the man at the front.
His voice sounded hoarse and unreal, and he had spoken with apparent effort.
"Meat is scarce," answered his comrade. "I ain't seen a rabbit sign for days."
Thereafter they spoke no more, though their ears were keen for the hunting-cries that continued to rise behind them.
At the fall of darkness they swung the dogs into a cluster of spruce trees on the edge of the waterway and made a camp. The coffin, at the side of the fire, served for seat and table. The wolf-dogs, clustered on the far side of the fire, snarled and bickered among themselves, but evinced no inclination to stray off into the darkness.
"Seems to me, Henry, they're stayin' remarkable close to camp," Bill commented.
Henry, squatting over the fire and settling the pot of coffee with a piece of ice, nodded. Nor did he speak till he had taken his seat on the coffin and begun to eat.
"They know where their hides is safe," he said. "They'd sooner eat grub than be grub. They're pretty wise, them dogs."
Bill shook his head. "Oh, I don't know."
His comrade looked at him curiously. "First time I ever heard you say anything about their not bein' wise."
"Henry," said the other, munching with deliberation the beans he was eating, "did you happen to notice the way them dogs kicked up when I was a-feedin' 'em?"
"They did cut up more'n usual," Henry acknowledged.
"How many dogs 've we got, Henry?"
"Six."
"Well, Henry . . . " Bill stopped for a moment, in order that his words might gain greater significance. "As I was sayin', Henry, we've got six dogs. I took six fish out of the bag. I gave one fish to each dog, an', Henry, I was one fish short."
"You counted wrong."
"We've got six dogs," the other reiterated dispassionately. "I took out six fish. One Ear didn't get no fish. I came back to the bag afterward an' got 'm his fish."
"We've only got six dogs," Henry said.
"Henry," Bill went on. "I won't say they was all dogs, but there was seven of 'm that got fish."
Henry stopped eating to glance across the fire and count the dogs.
"There's only six now," he said.
"I saw the other one run off across the snow," Bill announced with cool positiveness. "I saw seven."
Henry looked at him commiseratingly, and said, "I'll be almighty glad when this trip's over."
"What d'ye mean by that?" Bill demanded.
"I mean that this load of ourn is gettin' on your nerves, an' that you're beginnin' to see things."
"I thought of that," Bill answered gravely. "An' so, when I saw it run off across the snow, I looked in the snow an' saw its tracks. Then I counted the dogs an' there was still six of 'em. The tracks is there in the snow now. D'ye want to look at 'em? I'll show 'em to you."
Henry did not reply, but munched on in silence, until, the meal finished, he topped it with a final cup a of coffee. He wiped his mouth with the back of his hand and said:
"Then you're thinkin' as it was - "
A long wailing cry, fiercely sad, from somewhere in the darkness, had interrupted him. He stopped to listen to it, then he finished his sentence with a wave of his hand toward the sound of the cry, " - one of them?"
Bill nodded. "I'd a blame sight sooner think that than anything else. You noticed yourself the row the dogs made."
Cry after cry, and answering cries, were turning the silence into a bedlam. From every side the cries arose, and the dogs betrayed their fear by huddling together and so close to the fire that their hair was scorched by the heat. Bill threw on more wood, before lighting his pipe.
"I'm thinking you're down in the mouth some," Henry said.
"Henry . . . " He sucked meditatively at his pipe for some time before he went on. "Henry, I was a-thinkin' what a blame sight luckier he is than you an' me'll ever be."
He indicated the third person by a downward thrust of the thumb to the box on which they sat.
"You an' me, Henry, when we die, we'll be lucky if we get enough stones over our carcases to keep the dogs off of us."
"But we ain't got people an' money an' all the rest, like him," Henry rejoined. "Long-distance funerals is somethin' you an' me can't exactly afford."
"What gets me, Henry, is what a chap like this, that's a lord or something in his own country, and that's never had to bother about grub nor blankets; why he comes a-buttin' round the Godforsaken ends of the earth - that's what I can't exactly see."
"He might have lived to a ripe old age if he'd stayed at home," Henry agreed.
Bill opened his mouth to speak, but changed his mind. Instead, he pointed towards the wall of darkness that pressed about them from every side. There was no suggestion of form in the utter blackness; only could be seen a pair of eyes gleaming like live coals. Henry indicated with his head a second pair, and a third. A circle of the gleaming eyes had drawn about their camp. Now and again a pair of eyes moved, or disappeared to appear again a moment later.
The unrest of the dogs had been increasing, and they stampeded, in a surge of sudden fear, to the near side of the fire, cringing and crawling about the legs of the men. In the scramble one of the dogs had been overturned on the edge of the fire, and it had yelped with pain and fright as the smell of its singed coat possessed the air. The commotion caused the circle of eyes to shift restlessly for a moment and even to withdraw a bit, but it settled down again as the dogs became quiet.
"Henry, it's a blame misfortune to be out of ammunition."
Bill had finished his pipe and was helping his companion to spread the bed of fur and blanket upon the spruce boughs which he had laid over the snow before supper. Henry grunted, and began unlacing his mocassins.
"How many cartridges did you say you had left?" he asked.
"Three," came the answer. "An' I wisht 'twas three hundred. Then I'd show 'em what for, damn 'em!"
He shook his fist angrily at the gleaming eyes, and began securely to prop his moccasins before the fire.
"An' I wisht this cold snap'd break," he went on. "It's ben fifty below for two weeks now. An' I wisht I'd never started on this trip, Henry. I don't like the looks of it. I don't feel right, somehow. An' while I'm wishin', I wisht the trip was over an' done with, an' you an' me a-sittin' by the fire in Fort McGurry just about now an' playing cribbage - that's what I wisht."
Henry grunted and crawled into bed. As he dozed off he was aroused by his comrade's voice.
"Say, Henry, that other one that come in an' got a fish - why didn't the dogs pitch into it? That's what's botherin' me."
"You're botherin' too much, Bill," came the sleepy response. "You was never like this before. You jes' shut up now, an' go to sleep, an' you'll be all hunkydory in the mornin'. Your stomach's sour, that's what's botherin' you."
The men slept, breathing heavily, side by side, under the one covering. The fire died down, and the gleaming eyes drew closer the circle they had flung about the camp. The dogs clustered together in fear, now and again snarling menacingly as a pair of eyes drew close. Once their uproar became so loud that Bill woke up. He got out of bed carefully, so as not to disturb the sleep of his comrade, and threw more wood on the fire. As it began to flame up, the circle of eyes drew farther back. He glanced casually at the huddling dogs. He rubbed his eyes and looked at them more sharply. Then he crawled back into the blankets.
"Henry," he said. "Oh, Henry."
Henry groaned as he passed from sleep to waking, and demanded, "What's wrong now?"
"Nothin'," came the answer; "only there's seven of 'em again. I just counted."
Henry acknowledged receipt of the information with a grunt that slid into a snore as he drifted back into sleep.
In the morning it was Henry who awoke first and routed his companion out of bed. Daylight was yet three hours away, though it was already six o'clock; and in the darkness Henry went about preparing breakfast, while Bill rolled the blankets and made the sled ready for lashing.
"Say, Henry," he asked suddenly, "how many dogs did you say we had?"
"Six."
"Wrong," Bill proclaimed triumphantly.
"Seven again?" Henry queried.
"No, five; one's gone."
"The hell!" Henry cried in wrath, leaving the cooking to come and count the dogs.
"You're right, Bill," he concluded. "Fatty's gone."
"An' he went like greased lightnin' once he got started. Couldn't 've seen 'm for smoke."
"No chance at all," Henry concluded. "They jes' swallowed 'm alive. I bet he was yelpin' as he went down their throats, damn 'em!"
"He always was a fool dog," said Bill.


觅食之径
幽暗的杉林肃立在冰河两岸,一阵风过,吹落了覆盖在树上的白霜;在逐渐消逝的光里,树与树带着凝重的神情彼此依偎,仿佛某种预兆。(www.61k.com]苍凉的大地被无垠的沉寂笼罩,毫无生机和活力。它是如此寂寥、寒冷,远非悲伤的情绪所能涵盖。其中又透着一丝嘲弄,但这嘲弄比悲伤更可怕:如寒霜一般冷彻心骨,如斯芬克斯的笑容一样忧郁阴森,又带着无法撼动的冷峻。这是永恒用它那不可一世和无法言传的智慧,嘲笑生命的努力和徒劳。这就是荒原,北国的荒原,寒冷彻骨,充满野性。
但荒原上到处都有不肯顺从的生命。在被冻住的河道上,有一队狼犬正在艰难缓慢地移动。它们坚硬的皮毛上罩了一层霜;从嘴里呼出的气马上被冻住,变成一个个冰凌,落在身上,然后凝结成霜。它们身上套着皮轭,身后拖着一部用皮带拴着的雪橇。雪橇用坚实的桦树皮做成,不带滑板,整个底面都贴着雪地。雪橇的前端向上翘起,看起来像是卷轴,这是为了方便停下,也好滑过前方波浪般起伏的松软雪地。雪橇上紧紧捆着一只狭窄的长方形木盒,上面还有其他东西,几条毛毯,一把斧子,一个咖啡壶,和一只煎锅。但最占地方也最为显眼的,是那只狭窄的长方形木盒。
这队狼犬前方,一个男人在跋涉,他穿着巨大的雪鞋;雪橇后方也站着一个男人。雪橇上的木盒里还躺着一个,但他的跋涉已经结束。荒原将他征服,将他打倒在地,直到他再也无法前行或挣扎。生命是对荒原的冒犯,因为有生命就有运动,而荒原并不喜欢运动的存在,总想将它摧毁。荒原将河水凝固,使其无法汇入大海;吸干树木的汁液,直到它们坚强的内心也被冰封; 而最残酷无情的,是荒原对人类的侵袭,它让人类臣服于自己。荒原上的所有运动终将停止,而在所有生命中,人类最为躁动不安,一直反抗着它的律条:。
在雪橇前后两端,仍然活着的两个人正不屈不挠地向前跋涉。他们身穿裘皮和磨软的皮质服装,气息结成的冰屑糊满了睫毛、嘴唇和两颊,看不清脸。这让他们看起来像是戴着幽灵的面具,在为冥界的鬼魂承办丧礼。但面具之下,他们是人,在这片荒凉寂寥、充满嘲讽的大地上跋涉。这个世界如同宇宙中的无数深渊,偏远陌生且毫无生机。他们虽微弱渺小,但热衷于探险,他们要与这个世界的权威一较高下。
队伍继续前行,为了省些力气,两人一言不发。周遭一片寂静,像是有形的实体在压迫他们,像深水的压力影响潜水者的身体那样,扰动他们的情绪,。寂静带着不可更改的命令,以广阔空间的力量将他们碾压,逼迫他们退回到心灵的最深处。像挤葡萄汁一样,将他们心中不该有的热情、喜悦和过度的自尊压榨殆尽,直到他们明白自己不过是有限而渺小的尘埃,凭借虚弱无力的狡黠和小聪明,在伟大、隐蔽的物与力的相互作用中活动。
一小时过去了,又一个小时也过去了。白天短暂而阴郁,暗淡的光线开始消褪。这时,凝滞的空气中传来一声微弱的哀号,声音骤然上升,在最高点持续了一阵,紧张有力又令人心悸,然后渐渐消失。 如果声音中没有凄绝的凶狠和饥饿的渴望,或许是失落的灵魂在哭泣。前面的人转过头来,目光与另一个人相遇,隔着狭长的木盒子,两人朝彼此点了点头。
又一声哀号响起,尖锐刺耳的声音将寂静穿透。两人都听出了声音的位置,是在后方,在他们刚刚穿过的那片茫茫雪域。另一声回应的哀号响起,这一声也在后方,位于第二声哀号的左边。
前面的人说道:“比尔,它们在追赶我们,。”
他的声音听起来嘶哑,很不真实,说话时显然很吃力。
他的同伴回答道:“因为没有猎物,我好几天都没见着兔子的踪迹了。”
之后,他们便沉默不语,而是凝神谛听身后继续响起的猎食者的哀号。
夜幕来临之际,他们把队伍赶进河道旁的杉林,在那里扎了营。棺材放在火堆旁,既当凳子又当桌子。狼犬靠火堆较远,对着彼此咆哮,却丝毫不愿离开队伍,走进黑暗。
比尔说道:“亨利,我觉得它们离营地很近。”
亨利蹲在火堆旁,把咖啡壶用冰块垫好,然后点点头。他坐在棺材上开始吃饭时才说:
“这些狗很聪明,它们明白在哪儿更安全,也知道吃东西总比被吃掉要好。”
比尔摇了摇头,说:“哦,我不这么觉得。”
亨利好奇地看着他:“这还是我第一次听你说,它们不聪明。”
比尔用力咀嚼着嘴里的豌豆,说道:“亨利,我喂它们时,你有没有注意到这些狗躁动不安?”
亨利应道:“它们是没有平常安静。”
“亨利,我们有几只狗?”
“六只。”
“那么,亨利……”比尔顿了一下,以便他的话得到更多重视,“就像我说的,亨利,我们有六只狗。 我从包里拿了六条鱼,每只狗一条,然后我发现少一条鱼。”
“你数错了。”
比尔冷静地重复道:“我们有六只狗,然后我拿了六条鱼,有一只狗没吃到鱼,我又从包里拿了一条给它。”
亨利说道:“我们只有六只。”
比尔继续说:“亨利,我没说它们都是狗,吃到鱼的有七只。”
亨利放下食物,向火堆那边看了看,数了数有几只狗。
“只有六只。”他说。
比尔冷静肯定地说:“我看见有一只朝雪地跑去,我看见七只。”
亨利用怜悯的目光看他,然后说:“这趟旅程结束时,我会很高兴。”
“你这是什么意思?”比尔问道。

三 : hdu 1010 Tempter of the Bone 深搜+剪枝

Tempter of the Bone

Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)

Problem Description

The doggie found a bone in an ancient maze, which fascinated him a lot. However, when he picked it up, the maze began to shake, and the doggie could feel the ground sinking. He realized that the bone was a trap, and he tried desperately to get out of this maze.

The maze was a rectangle with sizes N by M. There was a door in the maze. At the beginning, the door was closed and it would open at the T-th second for a short period of time (less than 1 second). Therefore the doggie had to arrive at the door on exactly the T-th second. In every second, he could move one block to one of the upper, lower, left and right neighboring blocks. Once he entered a block, the ground of this block would start to sink and disappear in the next second. He could not stay at one block for more than one second, nor could he move into a visited block. Can the poor doggie survive? Please help him.

Input

The input consists of multiple test cases. The first line of each test case contains three integers N, M, and T (1 < N, M < 7; 0 < T < 50), which denote the sizes of the maze and the time at which the door will open, respectively. The next N lines give the maze layout, with each line containing M characters. A character is one of the following:

&#39;X&#39;: a block of wall, which the doggie cannot enter;

&#39;S&#39;: the start point of the doggie;

&#39;D&#39;: the Door; or

&#39;.&#39;: an empty block.

The input is terminated with three 0&#39;s. This test case is not to be processed.

Output

For each test case, print in one line "YES" if the doggie can survive, or "NO" otherwise.

Sample Input

4 4 5

S.X.

..X.

..XD

....

3 4 5

S.X.

..X.

...D

0 0 0

Sample Output

NO

YES

题意:在一个坐标内,给定起点和终点,问能否恰好在t时刻到达终点。

以前很少写搜索题,所以看到这个题,就按照普通的深搜写了一下,交上去超时了。后来在网上搜了一下才知道,要剪枝才行。可是,我以前从没写过剪枝,不知道怎么剪,就按照别人的思路往下想。看懂以后,我对剪枝的理解是:对于一些没有必要继续搜索的路径,不再往下深搜,提前返回到上一层。花了半天时间调试代码,终于AC了。

奇偶剪枝:根据题目,doggie必须在第t秒到达门口。也就是需要走t-1步。设doggie开始的位置为(sx,sy),目标位置为(ex,ey).如果abs(ex-x)+abs(ey-y)为偶数,则abs(ex-x)和abs(ey-y)奇偶性相同,所以需要走偶数步;

当abs(ex-x)+abs(ey-y)为奇数时,则abs(ex-x)和abs(ey-y)奇偶性不同,到达目标位置就需要走奇数步。先判断奇偶性再搜索可以节省很多时间,不然的话容易超时。t-sum为到达目标位置还需要多少步。因为题目要求doggie必须在第t秒到达门的位置,所以(t-step)和abs(ex-x)+abs(ey-y)的奇偶性必然相同。因此temp=(t-step)-abs(ex-x)+abs(ey-y)必然为偶数。

#include<stdio.h>#include<string.h>int flag,sx,sy,ex,ey,num;int n,m,t,vis[10][10];int dx[]={-1,0,1,0};int dy[]={0,-1,0,1};char map[10][10];int abs(int p){return p>=0?p:-p;}void dfs(int x,int y,int sum){int i,xx,yy;if(flag==1)return;if(x==ex&&y==ey&&sum==t){flag=1;return;}int mindis=abs(x-ex)+abs(y-ey); /*当前点到终点的最短距离*/if(mindis>t-sum||(mindis+ t-sum )%2!=0) return;for(i=0;i<4;i++){xx=x+dx[i];yy=y+dy[i];if(xx>=0&&xx<n&&yy>=0&&yy<m&&!vis[xx][yy]&&map[xx][yy]!=&#39;X&#39;) /*在map范围内且可以继续搜下去*/{vis[xx][yy]=1;dfs(xx,yy,sum+1);vis[xx][yy]=0;}}}int main(){int i,j;while(~scanf("%d%d%d",&n,&m,&t)){if(n==0&&m==0&&t==0)break;num=0;for(i=0;i<n;i++){scanf("%s",map[i]);for(j=0;j<m;j++){if(map[i][j]==&#39;S&#39;){sx=i;sy=j; /*记录起点坐标*/}if(map[i][j]==&#39;D&#39;){ex=i;ey=j; /*记录终点坐标*/}if(map[i][j]==&#39;X&#39;)num++; /*记录墙的数量*/}}if(n*m-num-1<t) { printf("NO\n"); continue; } flag = 0; memset(vis, 0, sizeof(vis)); vis[sx][sy] = 1; dfs(sx, sy, 0); if(flag) printf("YES\n"); else printf("NO\n");}return 0;}

本文标题:the last of us-完形填空 One of the main reasons that may stop us from
本文地址: http://www.61k.com/1057913.html

61阅读| 精彩专题| 最新文章| 热门文章| 苏ICP备13036349号-1