結果
問題 |
No.397 NO MORE KADOMATSU
|
ユーザー |
|
提出日時 | 2017-07-27 12:11:53 |
言語 | D (dmd 2.109.1) |
結果 |
AC
|
実行時間 | 24 ms / 2,000 ms |
コード長 | 400 bytes |
コンパイル時間 | 881 ms |
コンパイル使用メモリ | 103,544 KB |
実行使用メモリ | 25,476 KB |
平均クエリ数 | 36.83 |
最終ジャッジ日時 | 2024-06-12 21:15:18 |
合計ジャッジ時間 | 2,406 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 18 |
ソースコード
import std.algorithm, std.conv, std.range, std.stdio, std.string; void main() { auto n = readln.chomp.to!size_t; auto a = readln.split.to!(int[]); size_t[][] r; foreach (i; 0..n) { auto j = a[i..$].minIndex + i; if (i != j) { swap(a[i], a[j]); r ~= [i, j]; } } writeln(r.length); foreach (ri; r) writeln(ri[0], " ", ri[1]); stdout.flush(); readln; }