結果

問題 No.729 文字swap
ユーザー kageyama1234321kageyama1234321
提出日時 2018-11-17 17:18:49
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 889 bytes
コンパイル時間 93 ms
コンパイル使用メモリ 10,756 KB
実行使用メモリ 7,972 KB
最終ジャッジ日時 2023-08-26 01:45:24
合計ジャッジ時間 1,021 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
権限があれば一括ダウンロードができます

ソースコード

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:1])
print(foot)
print(str[foot-1:1])

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