s_id
stringlengths
10
10
p_id
stringlengths
6
6
u_id
stringlengths
10
10
date
stringlengths
10
10
language
stringclasses
1 value
original_language
stringclasses
11 values
filename_ext
stringclasses
1 value
status
stringclasses
1 value
cpu_time
int64
0
100
memory
stringlengths
4
6
code_size
int64
15
14.7k
code
stringlengths
15
14.7k
problem_id
stringlengths
6
6
problem_description
stringlengths
358
9.83k
input
stringlengths
2
4.87k
output
stringclasses
807 values
__index_level_0__
int64
1.1k
1.22M
s786063282
p00050
u765849500
1466219371
Python
Python
py
Accepted
10
6312
135
str = raw_input() str = str.replace("apple", "xxxxx") str = str.replace("peach", "apple") str = str.replace("xxxxx", "peach") print str
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,241
s922530689
p00050
u894114233
1468656727
Python
Python
py
Accepted
10
6252
125
sen=raw_input() sen=sen.replace("apple","?????") sen=sen.replace("peach","apple") sen=sen.replace("?????","peach") print(sen)
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,242
s964242229
p00050
u886766186
1471285184
Python
Python3
py
Accepted
20
7416
115
s = input() s = s.replace("apple", "temp") s = s.replace("peach", "apple") s = s.replace("temp", "peach"); print(s)
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,243
s579065961
p00050
u358919705
1473255818
Python
Python3
py
Accepted
20
7392
183
cs = list(input()) ap = [list('apple'), list('peach')] for i in range(len(cs) - 4): if cs[i: i + 5] in ap: cs[i: i + 5] = ap[1 - ap.index(cs[i: i + 5])] print(''.join(cs))
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,244
s895013928
p00050
u775586391
1480611414
Python
Python3
py
Accepted
20
7456
259
l1 = [i for i in input().rstrip()] l2 = "" l3 = "" for s in l1: l2 += s if "apple" in l2: l2 = l2.replace("apple","peach") l3 += l2 l2 = "" elif "peach" in l2: l2 = l2.replace("peach","apple") l3 += l2 l2 = "" l3 += l2 print(l3)
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,245
s113957646
p00050
u301729341
1481214197
Python
Python3
py
Accepted
30
7208
132
Sent = input() Sent = Sent.replace('apple', 'P') Sent = Sent.replace('peach', 'apple') Sent = Sent.replace('P', 'peach') print(Sent)
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,246
s288218350
p00050
u546285759
1483260287
Python
Python3
py
Accepted
20
7340
227
ans = [] for s in input().split(): if "apple" in s: ans.append(s.replace("apple", "peach")) elif "peach" in s: ans.append(s.replace("peach", "apple")) else: ans.append(s) print(" ".join(ans))
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,247
s484172500
p00050
u078042885
1483876306
Python
Python3
py
Accepted
20
7324
81
print(input().replace('apple','#').replace('peach','apple').replace('#','peach'))
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,248
s452657313
p00050
u711765449
1485602551
Python
Python3
py
Accepted
20
7420
103
s = input() s = s.replace('apple','tmp') s = s.replace('peach','apple') print(s.replace('tmp','peach'))
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,249
s143862840
p00050
u032662562
1488285010
Python
Python3
py
Accepted
30
7536
164
import re s = input().strip() kw = 'xxxx' while kw in s: kw = kw+'x' t = re.sub(r'apple',kw,s) u = re.sub(r'peach','apple',t) v = re.sub(kw,'peach',u) print(v)
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,250
s842193363
p00050
u964040941
1490147199
Python
Python3
py
Accepted
30
7400
288
while True: try: S = input() except EOFError: break for i in range(len(S) - 5 + 1): if S [i:i + 5] == 'apple': S = S [:i] + 'peach' + S [i + 5:] elif S [i:i + 5] == 'peach': S = S [:i] + 'apple' + S [i + 5:] print(S)
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,251
s407344145
p00050
u901080241
1491978628
Python
Python3
py
Accepted
20
7328
199
instr = input() for i in range(len(instr)-4): if instr[i:i+5] == "apple": instr = instr[:i]+"peach"+instr[i+5:] elif instr[i:i+5] == "peach":instr = instr[:i]+"apple"+instr[i+5:] print(instr)
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,252
s520008727
p00050
u462831976
1493092977
Python
Python3
py
Accepted
20
7420
353
# -*- coding: utf-8 -*- import sys import os import math import itertools d = {} d['A'] = 0 d['B'] = 0 d['AB'] = 0 d['O'] = 0 s = input().strip() apple_key = 'a)@#%^(@#)$&@' peach_key = 'p#*$^(#$&#)(*' s = s.replace('apple', apple_key) s = s.replace('peach', peach_key) s = s.replace(apple_key, 'peach') s = s.replace(peach_key, 'apple') print(s)
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,253
s217638546
p00050
u462831976
1493093093
Python
Python3
py
Accepted
20
7300
271
# -*- coding: utf-8 -*- import sys import os s = input().strip() apple_key = 'a)@#%^(@#)$&@' peach_key = 'p#*$^(#$&#)(*' s = s.replace('apple', apple_key) s = s.replace('peach', peach_key) s = s.replace(apple_key, 'peach') s = s.replace(peach_key, 'apple') print(s)
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,254
s851499367
p00050
u868716420
1496617008
Python
Python3
py
Accepted
30
7804
379
from collections import deque result = deque() for _ in input().split(): if 'apple' in _ : if _ == 'apple' : result.append('peach') else : result.append(_.replace('apple', 'peach')) elif 'peach' in _ : if _ == 'peach' : result.append('apple') else : result.append(_.replace('peach', 'apple')) else : result.append(_) print(*result)
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,255
s777844553
p00050
u519227872
1497627649
Python
Python3
py
Accepted
20
7344
236
s = input().split() ss = [] for w in s: a = w.find('apple') p = w.find('peach') if a != -1: w = w.replace('apple','peach') elif p != -1: w = w.replace('peach','apple') ss.append(w) print(' '.join(ss))
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,256
s546718507
p00050
u972901560
1499153538
Python
Python3
py
Accepted
20
7300
141
string = input() temp = string.replace("apple","temp") peach = temp.replace("peach","apple") dest = peach.replace("temp","peach") print(dest)
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,257
s234982240
p00050
u957021183
1504864850
Python
Python3
py
Accepted
30
7580
443
# Aizu Problem 0050: Apple and Peach # import sys, math, os # read input: PYDEV = os.environ.get('PYDEV') if PYDEV=="True": sys.stdin = open("sample-input.txt", "rt") dummy = "fadlsjkfhadslkjhfadskljghadsiuowzhgalsjdhflksjdhfasdjsadklfhasjdkhfalsdfhsadljkhfajdkshfadlfshadjkuihzuizt9285692843756239847ztsadhgsjaklg" for line in sys.stdin: print(line.strip().replace("apple", dummy).replace("peach", "apple").replace(dummy, "peach"))
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,258
s370787563
p00050
u546285759
1504977835
Python
Python3
py
Accepted
50
7368
236
ans = [] for word in input().split(): if "apple" in word: ans.append(word.replace("apple", "peach")) elif "peach" in word: ans.append(word.replace("peach", "apple")) else: ans.append(word) print(*ans)
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,259
s222012298
p00050
u811733736
1505181537
Python
Python3
py
Accepted
20
7436
437
# -*- coding: utf-8 -*- """ http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0050 Apple and Peach """ import sys def main(args): text = input() non_exist = 'qwertyuiop' while non_exist in text: non_exist += '@' text = text.replace('apple', non_exist) text = text.replace('peach', 'apple') text = text.replace(non_exist, 'peach') print(text) if __name__ == '__main__': main(sys.argv[1:])
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,260
s030369848
p00050
u724963150
1506887492
Python
Python3
py
Accepted
30
7608
235
import re out=[] for w in input().split(" "): if re.search("apple",w)!=None:out.append(re.sub("apple","peach",w)) elif re.search("peach",w)!=None:out.append(re.sub("peach","apple",w)) else:out.append(w) print(' '.join(out))
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,261
s206038040
p00050
u086896364
1509860906
Python
Python3
py
Accepted
20
7352
182
input_line1 = input() result = input_line1.replace('apple', 'xxxxxxxx') result = result.replace('peach', 'apple') result = result.replace('xxxxxxxx', 'peach') print(result)
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,262
s921053510
p00050
u600263347
1517053260
Python
Python3
py
Accepted
20
5556
344
def change_apple_peach(sentence): sentence = sentence.replace('apple','aaa') sentence = sentence.replace('peach','ppp') sentence = sentence.replace('aaa','peach') sentence = sentence.replace('ppp','apple') print(sentence) def main(): str = input() change_apple_peach(str) if __name__ == '__main__': main()
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,263
s440954508
p00050
u600263347
1517053787
Python
Python3
py
Accepted
20
5552
295
def change_apple_peach(sentence): sentence = sentence.replace('apple','aaa') sentence = sentence.replace('peach','apple') sentence = sentence.replace('aaa','peach') print(sentence) def main(): str = input() change_apple_peach(str) if __name__ == '__main__': main()
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,264
s279604074
p00050
u024715419
1517901683
Python
Python3
py
Accepted
20
5540
120
inp = input() tmp = inp.replace("apple", "XXX") tmp = tmp.replace("peach", "apple") print(tmp.replace("XXX", "peach"))
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,265
s447071845
p00050
u043254318
1518281191
Python
Python3
py
Accepted
20
5544
106
S = input() S = S.replace("apple","!") S = S.replace("peach","apple") S = S.replace("!","peach") print(S)
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,266
s298154545
p00050
u150984829
1519073832
Python
Python3
py
Accepted
20
5556
228
ans = [] for s in input().split(): if "apple" in s: ans.append(s.replace("apple", "peach")) elif "peach" in s: ans.append(s.replace("peach", "apple")) else: ans.append(s) print(" ".join(ans))
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,267
s203416169
p00050
u150984829
1519073965
Python
Python3
py
Accepted
20
5552
80
a,p,t='apple','peach','&' print(input().replace(a,t).replace(p,a).replace(t,p))
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,268
s732179054
p00050
u150984829
1519073980
Python
Python3
py
Accepted
20
5544
80
a,p,t='apple','peach','_' print(input().replace(a,t).replace(p,a).replace(t,p))
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,269
s456054392
p00050
u119127920
1520913726
Python
Python3
py
Accepted
50
6760
578
from collections import defaultdict, Counter from itertools import product, groupby, count, permutations, combinations from math import pi, sqrt from collections import deque from bisect import bisect, bisect_left, bisect_right from string import ascii_lowercase from functools import lru_cache import sys sys.setrecursionlimit(10000) INF = float("inf") YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no" def main(): S = input() print(S.replace("apple", "あ").replace("peach", "apple").replace("あ", "peach")) if __name__ == '__main__': main()
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,270
s540934024
p00050
u724606305
1523858145
Python
Python3
py
Accepted
20
5556
334
#入力して単語に分けてリスト化 s=input().split() #print(s) ss=[] for w in s: a=w.find("apple") p=w.find("peach") #find関数は見つからなかったら-1を返す if a!=-1: w=w.replace("apple","peach") elif p!=-1: w=w.replace("peach","apple") ss.append(w) print(" ".join(ss))
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,271
s805395503
p00050
u724548524
1527293139
Python
Python3
py
Accepted
20
5564
232
s = input().split() for i in range(len(s)): if "peach" in s[i]:n = s[i].index("peach");s[i] = s[i][:n] + "apple" + s[i][n + 5:] elif "apple" in s[i]:n = s[i].index("apple");s[i] = s[i][:n] + "peach" + s[i][n + 5:] print(*s)
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,272
s259232065
p00050
u352394527
1527518252
Python
Python3
py
Accepted
20
5548
110
s = input() s = s.replace("apple", "X") s = s.replace("peach", "apple") s = s.replace("X", "peach") print(s)
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,273
s227457943
p00050
u136916346
1527764922
Python
Python3
py
Accepted
40
6472
115
import re s=input() s=re.sub("peach","!!!!!",s) s=re.sub("apple","peach",s) s=re.sub("!!!!!","apple",s) print(s)
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,274
s196820100
p00050
u847467233
1529197803
Python
Python3
py
Accepted
20
5536
165
# AOJ 0050 Apple and Peach # Python3 2018.6.17 bal4u s = input() s = s.replace('apple', '_____') s = s.replace('peach', 'apple') print(s.replace('_____', 'peach'))
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,275
s646069228
p00050
u553148578
1529643250
Python
Python3
py
Accepted
20
5548
122
st = input() st = st.replace("apple","NULL") st = st.replace("peach", "apple") st = st.replace("NULL", "peach") print(st)
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,276
s087969109
p00050
u197615397
1530658224
Python
Python3
py
Accepted
40
6500
101
import re print(re.sub(r"(apple|peach)", lambda m: ["apple","peach"][m.group(0)=="apple"], input()))
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,277
s627597557
p00050
u504990413
1354718466
Python
Python
py
Accepted
10
5344
469
sent = map(str, raw_input()) for i in range(len(sent)-4): if sent[i] == 'a' and sent[i+1] == 'p' and sent[i+2] == 'p' and sent[i+3] == 'l' and sent[i+4] == 'e': sent[i], sent[i+1], sent[i+2], sent[i+3], sent[i+4], = 'p','e','a','c','h' elif sent[i] == 'p' and sent[i+1] == 'e' and sent[i+2] == 'a' and sent[i+3] == 'c' and sent[i+4] == 'h': sent[i], sent[i+1], sent[i+2], sent[i+3], sent[i+4], = 'a','p','p','l','e' print ''.join(sent)
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,278
s226468056
p00050
u290605490
1355841644
Python
Python
py
Accepted
10
4216
165
s=raw_input() for i in range(len(s)-4): if s[i:i+5]=="apple": s=s[:i]+"peach"+s[i+5:] elif s[i:i+5]=="peach": s=s[:i]+"apple"+s[i+5:] print s
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,279
s382635207
p00050
u647766105
1356203582
Python
Python
py
Accepted
10
4196
102
s=raw_input() s=s.replace("apple","@#") s=s.replace("peach","apple") s=s.replace("@#","peach") print s
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,280
s867240472
p00050
u310759044
1358150515
Python
Python
py
Accepted
10
4192
84
print raw_input().replace("apple","(").replace("peach","apple").replace("(","peach")
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,281
s547594415
p00050
u763301852
1364907257
Python
Python
py
Accepted
10
4200
90
print "peach".join(map(lambda x: x.replace("peach", "apple"), raw_input().split("apple")))
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,282
s371239802
p00050
u542421762
1370566174
Python
Python
py
Accepted
20
4212
238
import sys def solv(str): str = str.replace('apple', '_____') str = str.replace('peach', 'apple') str = str.replace('_____', 'peach') return str for line in sys.stdin: line = line.rstrip('\n') print solv(line)
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,283
s571102018
p00050
u782850731
1376206617
Python
Python
py
Accepted
20
4252
438
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import (division, absolute_import, print_function, unicode_literals) from sys import stdin for line in stdin: L = [] for w in line.split(): if 'apple' in w: L.append(w.replace('apple', 'peach')) elif 'peach' in w: L.append(w.replace('peach', 'apple')) else: L.append(w) print(*L)
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,284
s694489271
p00050
u454358619
1378167453
Python
Python
py
Accepted
10
4216
187
import sys d = raw_input() for i in range(len(d)): if d[i:i+5] == "apple": d = d[:i] + "peach" + d[i+5:] elif d[i:i+5] == "peach": d = d[:i] + "apple" + d[i+5:] print d
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,285
s088118859
p00050
u813384600
1381574629
Python
Python
py
Accepted
10
4192
89
print raw_input().replace('apple', '{}').replace('peach', 'apple').replace('{}', 'peach')
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,286
s399803565
p00050
u260980560
1384874630
Python
Python
py
Accepted
10
4184
84
print raw_input().replace("apple","%").replace("peach","apple").replace("%","peach")
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,287
s358918130
p00050
u912237403
1388768536
Python
Python
py
Accepted
10
4184
84
a="apple" b="peach" s=raw_input().replace(a,"X").replace(b,a).replace("X",b) print s
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,288
s196149263
p00050
u912237403
1388768718
Python
Python
py
Accepted
10
4184
80
a="apple" b="peach" print raw_input().replace(a,"X").replace(b,a).replace("X",b)
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,289
s306279623
p00050
u633068244
1393668619
Python
Python
py
Accepted
10
4204
205
msg = raw_input() for i in range(len(msg)-4): if msg[i:i+5] == "apple": msg = msg[:i] + "peach" + msg[i+5:] elif msg[i:i+5] == "peach": msg = msg[:i] + "apple" + msg[i+5:] print msg
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,290
s218317830
p00050
u246033265
1396807895
Python
Python
py
Accepted
10
4352
374
from itertools import * try: while True: a, p = 'apple', 'peach' b = raw_input() for i in count(0): if i >= len(b): break if b[i:i + len(a)] == a: b = b[:i] + p + b[i + len(a):] elif b[i:i + len(p)] == p: b = b[:i] + a + b[i + len(p):] print b except EOFError: pass
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,291
s041057065
p00050
u491763171
1401137528
Python
Python
py
Accepted
20
4180
101
print raw_input().replace('peach', 'HOGEHOGE').replace('apple', 'peach').replace('HOGEHOGE', 'apple')
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,292
s843176957
p00050
u436634575
1402302246
Python
Python3
py
Accepted
30
6720
83
print(input().replace('apple','@').replace('peach', 'apple').replace('@', 'peach'))
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,293
s039085014
p00050
u446235837
1403144085
Python
Python
py
Accepted
10
4216
348
def aaa(aa): return aa.replace('apple', 'peach') def bbb(bb): return bb.replace('peach', 'apple') a=raw_input().split() b = 0 for i in a: if 'apple' in i: i=aaa(i) a[b] = i b+=1 continue if 'peach' in i: i = bbb(i) a[b] = i b+=1 continue b+=1 print " ".join(a)
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,294
s715713910
p00050
u371026526
1597762589
Python
Python3
py
Accepted
20
5548
167
word = input() word = word.replace('apple','%a%') word = word.replace('peach','%p%') word = word.replace('%p%','apple') word = word.replace('%a%','peach') print(word)
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,295
s291556830
p00050
u695386605
1597758651
Python
Python3
py
Accepted
20
5548
119
s = input() a = s.replace('apple', 'orange') b = a.replace('peach', 'apple') c = b.replace('orange', 'peach') print(c)
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,296
s210406768
p00050
u140569607
1597758127
Python
Python3
py
Accepted
20
5548
114
s = str(input()) s = s.replace('apple', '-') s = s.replace('peach', 'apple') s = s.replace('-', 'peach') print(s)
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,297
s229970654
p00050
u350481745
1597757630
Python
Python3
py
Accepted
20
5548
98
n=input() n=n.replace('apple','x') n=n.replace('peach','apple') n=n.replace('x','peach') print(n)
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,298
s077390446
p00050
u470391435
1597734974
Python
Python3
py
Accepted
20
5552
109
a = input() a=a.replace('apple','AAAAA') a=a.replace('peach','apple') a=a.replace('AAAAA','peach') print(a)
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,299
s440974159
p00050
u799752967
1597731568
Python
Python3
py
Accepted
20
5540
135
# coding: utf-8 # Your code here! n=input() n=n.replace('apple','tmp') n=n.replace('peach','apple') print(n.replace('tmp','peach'))
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,300
s242239279
p00050
u322947441
1597730759
Python
Python3
py
Accepted
20
5536
107
l = str(input()); a = l.replace('apple', 'aa').replace('peach', 'apple'); print(a.replace('aa', 'peach'));
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,301
s086201920
p00050
u257570657
1597678251
Python
Python3
py
Accepted
20
5564
205
a=list(map(str,input().split())) for i in range(len(a)): if "peach" in a[i]: a[i]=a[i].replace("peach", "apple") elif "apple" in a[i]: a[i]=a[i].replace("apple", "peach") print(*a)
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,302
s078095464
p00050
u926092389
1597661639
Python
Python3
py
Accepted
30
5540
86
i=input() print(i.replace('apple','x').replace('peach','apple').replace('x','peach'))
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,303
s655821012
p00050
u444626963
1597649678
Python
Python3
py
Accepted
20
5540
93
Eng=input() print(Eng.replace('peach', 'X').replace('apple', 'peach').replace('X', 'apple'))
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,304
s463674290
p00050
u838993229
1597648817
Python
Python3
py
Accepted
20
5540
99
a = str(input()) b = a.replace('apple','X').replace('peach','apple').replace('X','peach') print(b)
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,305
s637023810
p00050
u397004753
1597556934
Python
Python3
py
Accepted
20
5548
104
s = input() s=s.replace("apple","り") s=s.replace("peach","apple") s=s.replace("り","peach") print(s)
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,306
s770855190
p00050
u053015104
1597265167
Python
Python3
py
Accepted
20
5564
199
n = input().split() for i in range(len(n)) : if "apple" in n[i] : n[i] = n[i].replace("apple", "peach") elif "peach" in n[i] : n[i] = n[i].replace("peach", "apple") print(*n)
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,307
s610000355
p00050
u583329397
1597229108
Python
Python3
py
Accepted
20
5544
106
s=str(input()) s=s.replace('apple', '_') s=s.replace('peach', 'apple') s=s.replace('_', 'peach') print(s)
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,308
s988444787
p00050
u596129030
1596986439
Python
Python3
py
Accepted
20
5544
132
w=input() w1=w.replace('peach','X') w2=w1.replace('apple','Y') w3=w2.replace('X','apple') w4=w3.replace('Y','peach') print(w4)
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,309
s681777586
p00050
u037263780
1596882176
Python
Python3
py
Accepted
20
5564
417
s=list(str(input())) for i in range(len(s)-4): if s[i]=='a' and s[i+1]=='p' and s[i+2]=='p' and s[i+3]=='l' and s[i+4]=='e': s[i]='p' s[i+1]='e' s[i+2]='a' s[i+3]='c' s[i+4]='h' elif s[i]=='p' and s[i+1]=='e' and s[i+2]=='a' and s[i+3]=='c' and s[i+4]=='h': s[i]='a' s[i+1]='p' s[i+2]='p' s[i+3]='l' s[i+4]='e' print(''.join(s))
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,310
s428284077
p00050
u826807985
1596779236
Python
Python3
py
Accepted
20
5536
101
n = input() print(n.replace('apple', 'X').replace('peach', 'apple').replace('X', 'peach'))
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,311
s328060936
p00050
u677563181
1596699261
Python
Python3
py
Accepted
20
5536
151
string = input() string = string.replace("apple","_apple").replace("peach","_peach").replace("_peach","apple").replace("_apple","peach") print(string)
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,312
s119704007
p00050
u555228137
1596518012
Python
Python3
py
Accepted
20
5544
104
a=input() a=a.replace('apple','momo') a=a.replace('peach','apple') a=a.replace('momo','peach') print(a)
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,313
s642727967
p00050
u633358233
1596495800
Python
Python3
py
Accepted
20
5536
87
x=input() print(x.replace("peach","X").replace("apple","peach").replace("X","apple"))
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,314
s738481284
p00050
u586171604
1596430446
Python
Python3
py
Accepted
20
5544
109
s=input() s=s.replace('apple', 'AAAAA') s=s.replace('peach', 'apple') s=s.replace('AAAAA', 'peach') print(s)
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,315
s689626768
p00050
u290304811
1596114567
Python
Python3
py
Accepted
20
5552
125
tmp = input() tmp = tmp.replace("apple","@") tmp = tmp.replace("peach","apple") tmp = tmp.replace("@","peach") print(tmp)
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,316
s260419524
p00050
u173393391
1596003028
Python
Python3
py
Accepted
20
5548
133
s=input() s=s.replace('apple', 'rrrrrrrrrrrrrrrrrr') s=s.replace('peach','apple') s=s.replace('rrrrrrrrrrrrrrrrrr','peach') print(s)
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,317
s647396916
p00050
u350963229
1595948926
Python
Python3
py
Accepted
20
5548
110
s = input() s = s.replace("apple", "x") s = s.replace("peach", "apple") s = s.replace("x", "peach") print(s)
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,318
s853875761
p00050
u630948380
1595896567
Python
Python3
py
Accepted
20
5548
115
L=input() L=L.replace("apple","kunimatsu") L=L.replace("peach","apple") L=L.replace("kunimatsu","peach") print(L)
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,319
s766796959
p00050
u057249340
1595895974
Python
Python3
py
Accepted
20
5552
113
x=input() x = x.replace('apple', 'tmp') x = x.replace('peach', 'apple') x = x.replace('tmp', 'peach') print(x)
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,320
s352348491
p00050
u795882061
1595693622
Python
Python3
py
Accepted
20
5540
91
d = input() print(d.replace('apple', 'X').replace('peach', 'apple').replace('X', 'peach'))
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,321
s163309786
p00050
u192469946
1595308585
Python
Python3
py
Accepted
20
5544
114
#0050 word = input() words = word.replace('peach','X').replace('apple','peach').replace('X','apple') print(words)
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,322
s378496123
p00050
u128671689
1595248504
Python
Python3
py
Accepted
20
5544
104
a=input() a1=a.replace("apple","x") a2=a1.replace("peach","apple") a3=a2.replace("x","peach") print(a3)
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,323
s682112582
p00050
u511292942
1595223871
Python
Python3
py
Accepted
20
5548
119
x = input() x = x.replace('apple', 'ringo') x = x.replace('peach', 'apple') x = x.replace('ringo', 'peach') print(x)
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,324
s928899384
p00050
u187074069
1594868171
Python
Python3
py
Accepted
20
5568
289
lst = list(input().split()) for num, i in enumerate(lst): if 'apple' in i: n = i.find('apple') lst[num] = i[:n] +'peach' + i[n+5:] elif 'peach' in i: n = i.find('peach') lst[num] = i[:n] + 'apple' + i[n+5:] else: pass print(*lst)
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,325
s553200754
p00050
u647921435
1594272614
Python
Python3
py
Accepted
20
5544
86
x=input() print(x.replace("peach","X").replace("apple","peach").replace("X","apple"))
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,326
s100024625
p00050
u395654950
1594014781
Python
Python3
py
Accepted
20
5540
131
# coding: utf-8 # Your code here! s = input() print(s.replace("apple", "あ").replace("peach", "apple").replace("あ", "peach"))
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,327
s481318370
p00050
u320921262
1593412589
Python
Python3
py
Accepted
20
5552
98
a=input() b=a.replace('apple','&') c=b.replace('peach','apple') d=c.replace('&','peach') print(d)
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,328
s737057396
p00050
u940828136
1593348069
Python
Python3
py
Accepted
20
5544
109
x = input() x = x.replace('apple', '___') x = x.replace('peach', 'apple') print(x.replace('___', 'peach'))
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,329
s874595587
p00050
u747915832
1592816149
Python
Python3
py
Accepted
20
5544
143
text = input() text = text.replace('apple', 'ringo') text = text.replace('peach', 'apple') text = text.replace('ringo', 'peach') print(text)
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,330
s405556825
p00050
u862272701
1592808757
Python
Python3
py
Accepted
20
5552
166
try: s = input() s = s.replace('apple','xxxxx') s = s.replace('peach','apple') s = s.replace('xxxxx','peach') print(s) except: print('')
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,331
s825046498
p00050
u994684803
1592386697
Python
Python3
py
Accepted
20
5548
107
a = input() a = a.replace("apple","*") a = a.replace("peach","apple") a = a.replace("*","peach") print(a)
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,332
s783117056
p00050
u988962397
1592130046
Python
Python3
py
Accepted
20
5544
99
bun=input() print(bun.replace("apple", "KKKK").replace("peach", "apple").replace("KKKK", "peach"))
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,333
s483415161
p00050
u228556128
1591964473
Python
Python3
py
Accepted
20
5544
89
s=input() print(s.replace('peach', 'X').replace('apple', 'peach').replace('X', 'apple'))
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,334
s325801527
p00050
u814278309
1591875937
Python
Python3
py
Accepted
20
5548
109
n = input() n = n.replace('apple','x') n = n.replace('peach','apple') n = n.replace('x','peach') print(n)
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,335
s487512147
p00050
u240091169
1590643078
Python
Python3
py
Accepted
20
5556
215
A = list(input().split()) for i in range(len(A)) : if "apple" in A[i] : A[i] = A[i].replace("apple", "peach") elif "peach" in A[i] : A[i] = A[i].replace("peach", "apple") print(" ".join(A))
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,336
s194815941
p00050
u580977620
1589869149
Python
Python3
py
Accepted
20
5596
389
input_str = input() str_len = len(input_str) index = 0 while index < str_len: if input_str[index:].startswith('apple'): print('peach', end='') index += 5 elif input_str[index:].startswith('peach'): print('apple', end='') index += 5 else: print(input_str[index], end='') index += 1 if (index == str_len): print('')
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,337
s835334469
p00050
u037441960
1589527055
Python
Python3
py
Accepted
20
5612
433
s = input() S = [] a = "apple" p = "peach" A = [] P = [] for i in range(len(s)) : S.append(s[i]) for i in range(5) : A.append(a[i]) P.append(p[i]) for i in range(len(S)) : if S[i : i + 5] == A : S[i : i + 5] = P elif S[i : i + 5] == P : S[i : i + 5] = A for i in range(len(S)) : if i == len(S) - 1 : print(S[i]) else : print(S[i], sep = "", end = "")
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,338
s617730516
p00050
u842461513
1589262586
Python
Python3
py
Accepted
20
5544
258
str1 = input() #標準入力 str1 = str1.replace("apple","kari") #"apple"を"kari"に変換する str1 = str1.replace("peach","apple") #"peach"を"apple"に変換する str1 = str1.replace("kari","peach") #"kari"を"peach"に変換する print(str1) #出力
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,339
s057339088
p00050
u014861569
1589007335
Python
Python3
py
Accepted
20
5536
91
s=input() s=s.replace('apple','X').replace('peach','apple').replace('X','peach') print(s)
p00050
<H1>りんごと桃</H1> <p> 福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。 </p> <p> あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。1行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。 </p> <H2>Input</H2> <p> 英文(半角英数字、空白、記号を含む)が1行に与えられます。入力される文字列の長さは 1000 以下です。 </p> <H2>Output</H2> <p> apple とpeach という文字列を交換した英文を1行に出力します。 </p> <H2>Sample Input</H2> <pre> the cost of one peach is higher than that of one apple. </pre> <H2>Output for the Sample Input</H2> <pre> the cost of one apple is higher than that of one peach. </pre>
the cost of one peach is higher than that of one apple.
the cost of one apple is higher than that of one peach.
10,340