翻译一句话

发布网友 发布时间:2022-04-20 09:13

我来回答

11个回答

懂视网 时间:2022-05-03 05:43

USACO的快乐农场题目
技术图片
题目大意
求结点1到n的严格次次短路径。

因为不久前刚刚看过了最短路计数这道题目,所以就想在求最短路的时候,用dis数组记录最短路和次短路,然后就愉快的打完了代码,过了样例,然后50……
技术图片

下面是50分代码

#include <bits/stdc++.h>
#define id tmp.second
#define di tmp.first
using namespace std;
typedef pair<int, int> PI;
const int M = 300500;
int n, r, head[M], tot, dis[M][2], vis[M];
struct EDGE{
int v, w, nxt;
}e[M];
priority_queue<PI, vector<PI>, greater<PI> > q;
PI tmp;

void add(int x, int y, int z)
{
e[++tot].v = y, e[tot].nxt = head[x], e[tot].w = z, head[x] = tot;
}

void Dijkstra()
{
memset(dis, 0x4f, sizeof(dis));
dis[1][0] = dis[1][1] = 0;
q.push(make_pair(0, 1));
while (!q.empty())
{
tmp = q.top(), q.pop();
if (vis[id]) continue;
vis[id] = 1;
for (int i = head[id]; i; i = e[i].nxt)
{
if (dis[e[i].v][0] > di + e[i].w)
{
dis[e[i].v][1] = dis[e[i].v][0], dis[e[i].v][0] = di + e[i].w;
if (!vis[e[i].v]) q.push(make_pair(dis[e[i].v][0], e[i].v));
}
else if (dis[e[i].v][1] > di + e[i].w) dis[e[i].v][1] = di + e[i].w;
}
}
}

int main()
{
int x, y, z;
ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
cin >> n >> r;
for (int i = 1; i <= r; ++i) cin >> x >> y >> z, add(x, y, z), add(y, x, z);
Dijkstra();
printf("%d", dis[n][1]);
return 0;
}

然后,我重新想了想我在求最短路的时候的判断,发现50这个样子写,最小值可能会覆盖次小值,因为我只判断了一遍的范围,没有限制次小值严格小于最小值。而且题目要求一条路可以重复走多次,所以我增加了每个点可以经过的次数。
判断部分就成了这个样子

for (int i = head[id]; i; i = e[i].nxt)
{
if (dis[e[i].v][0] > di + e[i].w)
{
dis[e[i].v][1] = dis[e[i].v][0], dis[e[i].v][0] = di + e[i].w;
if (dis[e[i].v][1] > dis[id][1] + e[i].w && dis[e[i].v][0] < dis[id][1] + e[i].w)
dis[e[i].v][1] = dis[id][1] + e[i].w;
if (vis[e[i].v] < 2) q.push(make_pair(dis[e[i].v][0], e[i].v));
}
else
if (dis[e[i].v][1] > di + e[i].w && dis[e[i].v][0] < di + e[i].w)
{
dis[e[i].v][1] = di + e[i].w;
q.push(make_pair(dis[e[i].v][0], e[i].v));
}
else
if (dis[e[i].v][1] > dis[id][1] + e[i].w && dis[e[i].v][0] < dis[id][1] + e[i].w)
dis[e[i].v][1] = dis[id][1] + e[i].w;
}

这样就过了90分!
然后下载了错误数据,发现还是错在了一条边可以走多次的问题上。因为走多次的话,第一个点的次短路就不一定是0了,所以我把初始化只改成了初始化1号点的最短路。这样就过了这个题。
下面是AC代码

#include <bits/stdc++.h>
#define id tmp.second
#define di tmp.first
using namespace std;
typedef pair<int, int> PI;
const int M = 300500;
int n, r, head[M], tot, dis[M][2], vis[M];
struct EDGE{
int v, w, nxt;
}e[M];
priority_queue<PI, vector<PI>, greater<PI> > q;
PI tmp;

void add(int x, int y, int z)
{
e[++tot].v = y, e[tot].nxt = head[x], e[tot].w = z, head[x] = tot;
}

void Dijkstra()
{
memset(dis, 0x4f, sizeof(dis));
dis[1][0] = 0;
q.push(make_pair(0, 1));
while (!q.empty())
{
tmp = q.top(), q.pop();
if (vis[id] == 2) continue;
++vis[id];
for (int i = head[id]; i; i = e[i].nxt)
{
if (dis[e[i].v][0] > di + e[i].w)
{
dis[e[i].v][1] = dis[e[i].v][0], dis[e[i].v][0] = di + e[i].w;
if (dis[e[i].v][1] > dis[id][1] + e[i].w && dis[e[i].v][0] < dis[id][1] + e[i].w)
dis[e[i].v][1] = dis[id][1] + e[i].w;
if (vis[e[i].v] < 2) q.push(make_pair(dis[e[i].v][0], e[i].v));
}
else
if (dis[e[i].v][1] > di + e[i].w && dis[e[i].v][0] < di + e[i].w)
{
dis[e[i].v][1] = di + e[i].w;
if (vis[e[i].v] < 2) q.push(make_pair(dis[e[i].v][0], e[i].v));
}
else
if (dis[e[i].v][1] > dis[id][1] + e[i].w && dis[e[i].v][0] < dis[id][1] + e[i].w)
dis[e[i].v][1] = dis[id][1] + e[i].w;
}
}
}

int main()
{
int x, y, z;
ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
cin >> n >> r;
for (int i = 1; i <= r; ++i) cin >> x >> y >> z, add(x, y, z), add(y, x, z);
Dijkstra();
printf("%d", dis[n][1]);
return 0;
}

技术图片

Roadblocks题解

标签:限制   size   ace   初始   cond   printf   code   ==   ble   

热心网友 时间:2022-05-03 02:51

爱意味着我渴求我爱的人,但并非缺少他就无法生存。

http://spaces.msn.com/renbenneng/Blog/cns!1pzVRvu-nL8jreNZrB3ZvDqw!138.entry

更多爱情方面的名言:

1.Love means that I know the person I love.
I’m aware of the many sides of the other person – not just the beautiful side, but also the limitations, inconsistencies and flaws.
I have an awareness of the other’s feelings and thoughts, and I experience something of the core of that person.
I can penetrate social masks and roles, and see the other person on a deeper level.
爱意味着我了解我爱的人。我认识到对方的许多方面,不仅是美丽闪光的一面,还有能力上的不足、反复无常和性格上的缺陷。我了解对方的感情和想法,我能体验到那个人身上的某种本质的东西。我能透过对方社交场合的表现和在社会上的角色,看到他更深层次的品质。

2.Love means that I care about the welfare of the person I love.
To the extent that it is genuine, my caring is not a smothering of ther person or a possessive clinging. On the contrary, my caring liberates both of us.
If I care about you, I’m concerned about your growth, and I hope you will become all that you can become.
Consequently, I don’t put up roadblocks to what you do that enhances you as a person, even though it may result in my discomfort at times.
爱意味着关心我爱的人的幸福健康。只要这种关心是真诚的,那么她就不会是某种压制或占有性的依附。与此相反,我的关心使我们两个人都不受到束缚。如果我关心你,我会就关注你的成长,我希望你将来成为一个有所作为的人。
因此,对你为了提高自己所作的事,我绝不设置障碍,即使你做的事情有时会使我不快。

3.Love means having respect for the dignity of the person I love.If I love you, I can see you as a separate person, with your own values and thoughts and feelings, and I do not insist that you surrender your identity and conform to an image of what I expect you to be for me. I can allow and encourage you to stand alone, and to be who you are, and I avoid treating you as an object or using you primarily to gratify my own needs.
爱意味着尊重我爱的人的尊严。如果我爱你,我会把你看作独立的人,有自己的价值观、思想和感受,我不会为了使你成为我所期望的那种人而坚持让你放弃自己的特点。我会允许并鼓励你保持独立,坚持自己的特色。我避免把你当作一件东西对待或多用你来满足我自身的需要。
4.Love means having a responsibility toward the person I love.
If I love you, I’m responsive to most of your major needs as a person.
This responsibility does not entail my doing for what you are capable of doing for yourself; now does it mean that I run your life for you.
It does imply acknowledging that what I am and what I do affects you, so that I am directly involved in your happiness and your misery.
A lover does have the capacity to hurt or neglect the loved one, and in this sense I see that love entails an acceptance of some responsibility for the impact my way of being has on you.
爱意味着对我爱的人有责任心。如果我爱你,我就会对你的大多数主要需求有所反应。这种责任心并不是说我为你做你能够自己做的事,也不意味着我为你来管理你的生活。它真正意味着承认我的为人和我的所为对你的影响力,我因此而直接分享你的快乐和痛苦。一个人的确可能会伤害或忽视他所爱的人,在这个意义上,我认为爱包含着我对我的生活方式对你所造成的影响承担责任。

5.Love means growth for both myself and the person I love.
If I love you, I am growing as a result of my love.
You are a stimulant for me to become more fully what I might become, and my loving enhances your being as well.
We each grow as a result of caring and being care for; we each share in an enriching experience that does not detract from our being.
爱意味着我和我爱的人都在成长。如果我爱你,我会因爱你而成长。你是激励我更加充实的动力,我的爱也会令你不断完善提高。我们因爱与被爱而成长;我们彼此分享成长的经验而又不削弱自己的个性。
6.Love means making a commitment to the person I love.This commitment does not entail surrendering our total selves to each other; nor does it imply that the relationship is necessarily permanent.
It does entail a willing ness to stay with each other in times of pain, uncertainty, struggle and despair, as well as in times of calm and enjoyment.
爱意味着对我爱的人做出承诺。这种承诺并不是说我们要放弃自己的个性;也不是指这种关系是一成不变的。这种承诺却包含着我们愿意在痛苦、犹豫、斗争和绝望时刻彼此之间相互支持,就好像在平静和快乐的时刻一样互相支持一样。
7.Love means trusting the person.
If love you, I trust that you will accept my caring and my love and that won’t deliberately hurt me.
I trust the reciprocal nature of our love.
If we trust each other, we are willing to be open to each other and can shed masks and pretenses and reveal our true selves.
爱意味着信任我爱的人。
如果我爱你,我相信你会感受我对你的关心和爱意,并且不会故意伤害我。
我相信我们的爱是相互的。
如果我们互相信任,那么我们就愿意敞开心扉,摘下面具,去掉伪装,显示我们真实的自我。
8.
Love can tolerate imperfection.
In a love relationship there are times of boredom, times when I may feel like giving up, times of real strain and times I experience an impasse. Authentic love does not imply enring happiness. I can stand ring rough times, however, because I can remember what we had together in the past, and I can picture what we will have together in our future if we care enough to face our problems and work them through.
Love is a spirit that changes life. Love is a way of life that is creative and that transforms.
However, I do not view love as being reserved for a perfect world.
‘Love is meant for our imperfect world where things go wrong.
Love is meant to be a spirit that works in painful situations.
Love is meant to bring meaning into life where nonsense appears to reign.’
In other words, love comes into an imperfect world to make it livable.
爱意味着容忍缺点。
在爱情中,会有厌烦的时候,想放弃的时候,有非常紧张的时候,面临绝境的时候。珍爱不仅仅意味着能共同分享幸福的时刻,在艰难困苦的时刻我也能和你在一起,因为我记得我们过去在一起度过的时刻,也能想象如果我们面对问题并度过难关,我们将来在一起的样子。
爱是改变生活的精神力量。爱是一种创造性的生活方式并能改善生活。
但我并不认为爱只存在于完美世界。
“爱是给予我们这个存在问题的不完美世界的。
爱是在痛苦境遇下起作用的精神。
爱使看似无意义的生活变得有意义”
换言之,爱使人们在这个不完美的世界得以存活。
9.
Love is freeing.
Love is freely given, not doled out on demand.
At the same time, my love for you is not dependent on whether you fulfill my expectations of you.
Authentic love does not imply ‘I’ll love you when you become perfect or when you become what I expect you to become.’
Authentic love is not given with strings attached.
There is an unconditional quality about love.
爱使人自由。
爱是自愿的付出,而不是应要求的施舍。
与此同时,我对你的爱并不取决于你是否满足了我的期望。
真爱并不是”当你成为完美的人,或当你成为我所期望的那种人时,我才爱你。”
真爱不是带有附加条件的付出。
爱是无条件的。
10.
Love is expansive.
If I love you, I encourage you to reach out and develop other relationships.
Although our love for each other and our commitment to each other might bar certain actions on our parts, we are not totally and exclusively wedded to each other.
It is a pseud love that cements one person to another in such a way that he or she is not given room to grow.
爱是博大的。
如果我爱你,我会鼓励你向外发展,建立其他的人际关系。
虽然我们之间的爱和对彼此的承诺可能不允许我们做某些事情,但我们并不是被完全拴在一起的
把一个人和另外一个人拴在一起而不给予他发展的空间,这是虚伪的爱。
11.The honest evidence of our love is your commitment to encourage another’s full development.
We are interdependent personalities who need one another’s presence in order to fulfill our destiny.
And yet, we are also separate indivials.
We must come to terms with our struggles alone.
承诺要鼓励对方的充分发展是我们之间的爱的真切证明。
我们相互依存,需要对方的存在来完整自己的命运。
然而我们又是独立的个体。
我们必须独立面对各自的奋斗
12.Love means having a want for the person I love without having a need for that person in order to be complete.
If I am nothing without you, then I’m not free to love you.
I love you and you leave, I’ll experience a loss and be sad and lonely, but I’ll still be able to survive.
If I am overly dependent on you for my meaning and my survival, then I am not free to challenge our relationship, nor am I free to challenge and confront you.
Because of my fear of losing you, I’ll settle for less than I want, and this settling will surely lead to feelings of resentment.

爱意味着我渴求我爱的人,但并非缺少他就无法生存。
如果缺少你就无法生存,那么我就不能自由的爱你。
我爱你,你若离开,我会失落、难过和孤独,但我还能继续生活。
如果我的价值和生存过于依赖你,我就无法审视我们之间的关系,也就无法审视并与你对峙。
因为我害怕失去你,我就会降低要求以求安稳,而这势必使我产生不满情绪。
13.Love means identifying with the person I love.
If I love you, I can empathize with you and see the world through your eyes.I can identify with you because I ‘m able to see myself in you and you in me.This closeness does not imply a continual “togetherness” for distance and separation are sometimes essential in a loving relationship.
Distance can intensify a loving bond, and it can help us rediscover ourselves, so that we are able to meet each other in a new way.
爱意味着能够理解我爱的人。
如果我爱你,我就能理解你并通过你的眼睛去看世界。
我能理解你是因为我能在你身上看到我自己,就如你在我身上也看到了你。这种亲密并不意味着一定要一直呆在一起,因为距离和分别在爱中亦有必要。距离会使爱的联系加强,有助于我们重新发现自己,从而帮助我们以新的方式走进对方的生活。

14.Love is selfish.
I can only love you if I genuinely love, value, appreciate, and respect myself.
If I am empty, then all I can give you is my emptiness.If I feel that I’m complete and worthwhile in myself, then I’m able to give to you out of my fullness.
One of the best ways for me to give you love is by fully enjoying myself with you.
爱是从自我出发的。只有我能爱自己、珍视自己、欣赏自己、尊重自己,我才能爱你。
如果我很空虚,我只能给予你空虚。
如果我感到自己完整而有价值,那么我就能让你分享我的充实。对我来说,给予你爱的最好方式就是和你在一起完全分享我的一切。

15.Love involves seeing the potential within the person we love.
In my love for another, I view her or him as the person she or he can become, while still accepting who and what the person is now. Goethe’s observation is relevant here: by taking people as they are, we make them worse, but by treating them as if they already were what they ought to be, we help make them better.
爱包含着能看到我爱的人的潜力。
我对对方的爱是指我把他看作是他将来能够成为的那种人,与此同时承认他的现状。歌德有一句与此相关的评论:根据人们的现状来对待他们,我们会使他们变得越来越糟,按照他们应达到的目标来对待他们,我们就会帮助他们变得更好。

16.
Mature love is union under the condition of preserving one’s integrity, one’s indiviality.
In love this paradox occurs that two beings becomes one and yet remain two.
成熟的爱是基于保持各自完整和独立性的结合。
合二为一,却又仍是各自独立,这样的悖论在爱中的确存在。

热心网友 时间:2022-05-03 04:09

爱情意味着希望拥有我爱的人,但为了使对方完整而不索求什么。

热心网友 时间:2022-05-03 05:44

爱就是对一个人的渴望而不是对他的索求,有了他,生命才完整。

热心网友 时间:2022-05-03 07:35

爱意味意着对所爱的人的一种渴望,而对她(他)却没有所图.

热心网友 时间:2022-05-03 09:43

爱意味着对所爱的人付出,而不是索求,这样的爱才是完美的!

热心网友 时间:2022-05-03 12:08

爱意味着对爱的人付出而不是索求,那样的人应该称得上完美!

热心网友 时间:2022-05-03 14:49

爱,意味着希望拥有所爱,而非完全的占有

热心网友 时间:2022-05-03 17:47

意味着对我所爱的人有所需求,但不是离开了你就不行。

热心网友 时间:2022-05-03 21:02

pazu88翻译的最贴切,你选ta的吧

出自kokia的意大利文歌曲Gift的开篇文
并不是什么纪念品上的胡乱英文
以下是正确的原文
请尊重作者

it's equal for us to be here to share the time of now
我们可以平等地分享现在
so, what if there is a time of sorrow, pain and anger?
可那些让人痛苦悲愤的时刻呢?
i would like to believe that is a gift from God to decorate this time
我想那是上天的眷顾来点装岁月

热心网友 时间:2022-05-04 00:33

错了
声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。
E-MAIL:11247931@qq.com