結果
| 問題 |
No.490 yukiソート
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-03-10 22:35:21 |
| 言語 | D (dmd 2.109.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 802 bytes |
| コンパイル時間 | 1,849 ms |
| コンパイル使用メモリ | 160,420 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-06-12 07:18:00 |
| 合計ジャッジ時間 | 2,957 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 WA * 1 |
| other | AC * 19 WA * 15 |
ソースコード
import std.stdio, std.string, std.conv, std.range, std.array, std.algorithm;
import std.uni, std.math, std.container, std.typecons, std.typetuple;
import core.bitop, std.datetime;
void main(){
auto n = readln.chomp.to!int;
auto a = readln.split.to!(int[]);
foreach(i ; 1 .. 2*n - 3){
foreach(p ; 0 .. i/2){
int q = i - p;
if(p != q && 0 <= q && q < n){
if(a[p] > a[q]){
swap(a[p], a[q]);
}
}
}
}
writefln("%(%s %)", a);
}
void readVars(T...)(auto ref T args){
auto line = readln.split;
foreach(ref arg ; args){
arg = line.front.to!(typeof(arg));
line.popFront;
}
if(!line.empty){
throw new Exception("args num < input num");
}
}