結果
問題 |
No.397 NO MORE KADOMATSU
|
ユーザー |
![]() |
提出日時 | 2016-07-20 21:17:04 |
言語 | Python2 (2.7.18) |
結果 |
RE
|
実行時間 | - |
コード長 | 444 bytes |
コンパイル時間 | 219 ms |
コンパイル使用メモリ | 7,072 KB |
実行使用メモリ | 25,856 KB |
平均クエリ数 | 501.89 |
最終ジャッジ日時 | 2024-07-16 10:43:59 |
合計ジャッジ時間 | 3,048 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 9 RE * 9 |
ソースコード
from sys import stdout def iskadomatsu(a,b,c): return b>a>c or b>c>a or b<a<c or b<c<a N = int(raw_input()) A = map(int,raw_input().split()) M = 0 op = [] for i in xrange(N-2): if iskadomatsu(A[i],A[i+1],A[i+2]):break else: print 0 stdout.flush() input() quit() for i in xrange(N): for j in xrange(i+1,N): if A[j]<A[j-1]: A[j-1],A[j]=A[j],A[j-1] M+=1 op.append([j-1,j]) print M for u,v in op: print u,v stdout.flush() input()