結果
| 問題 |
No.927 Second Permutation
|
| コンテスト | |
| ユーザー |
ngtkana
|
| 提出日時 | 2020-02-06 12:59:46 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 576 bytes |
| コンパイル時間 | 916 ms |
| コンパイル使用メモリ | 109,784 KB |
| 実行使用メモリ | 28,860 KB |
| 最終ジャッジ日時 | 2024-09-25 06:44:55 |
| 合計ジャッジ時間 | 5,861 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 1 |
| other | AC * 2 WA * 25 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System;
using System.Linq;
using System.Collections.Generic;
static class NagataKanaIsAGenius {
public static void Main() {
char[]s=Console.ReadLine().ToArray();
if(s.Length==
2&&s[1]=='0'){
Console.WriteLine(-1);
Environment.Exit(0);
}
Array.Sort(s);
Array.Reverse(s);
s[s.Length-2]^=s[s.Length-1];
s[s.Length-1]^=s[s.Length-2];
s[s.Length-2]^=s[s.Length-1];
foreach(char c in s){
Console.Write(c);
}
Console.WriteLine("");
}
}
ngtkana