結果

問題 No.729 文字swap
ユーザー kageyama1234321
提出日時 2018-11-17 17:17:57
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 887 bytes
コンパイル時間 116 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-12-24 14:39:19
合計ジャッジ時間 1,104 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 3
other WA * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

str = input()
aaa = input()
split_first = aaa.split()
head = int(split_first[0])
foot = int(split_first[1])


#print(str)
#print(aaa)

print(head)
print(str[head:0])
print(foot)
print(str[foot:0])

subHead =  str[head:head]
subFoot =  str[foot:foot]

if head > 0:
  headStr = str[0:head]
else:
  headStr = "" 

if (foot - head) >1 :
  centStr =  str[head+1:foot-1]
else:
  centStr =  ""

if foot <  len(str):
  footStr = str[foot+1:len(str)]
else:
  footStr = ""

print(headStr + subHead+  centStr  + subFoot+ footStr)


#print(first#)
#leng= (len(first))
#lengheaf= (len(first)//2)
#lengheaf= (leng//2)
#print(lengheaf)

#print("比較開始")
#print(text[0: lengheaf])
#print(text[lengheaf:leng])

#if text[0: lengheaf] == text[lengheaf:leng]:
#if first[0: lengheaf] == first[lengheaf:leng]:
#    print("YES")
#else:
#    print("NO")
0