0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

ABC390

Posted at

久しぶりにAtCodeに参加した.完全に分からなかった.今まではCくらいまでは解けていたのに今回は,Aしか解けなかった.
これからはちょくちょく頑張ろう.

import sys

input = sys.stdin.readline
n = list(input().split())
count = 0
ans= False
for index,mm in enumerate(n):
    if (index+1) != int(mm):
        count+=1
        if count>=2 and index != int(n(index)):
            ans = True

if count==2 and ans:
    print('Yes')
else:
    print('No')
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?