結果

問題 No.927 Second Permutation
ユーザー mai
提出日時 2019-11-22 21:35:06
言語 cLay
(20241019-1)
結果
WA  
実行時間 -
コード長 244 bytes
コンパイル時間 1,833 ms
コンパイル使用メモリ 175,848 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-07-05 13:26:52
合計ジャッジ時間 2,408 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 10 WA * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

string s;
{
  cin>>s;
  sort(s.begin(), s.end());
  reverse(s.begin(), s.end());
  auto ok=next_permutation(s.begin(), s.end());
  ok &= s.back() != '0';
  if (ok)
    for(auto it=s.rbegin();it!=s.rend();++it) putchar(*it);
  else
    wt(-1);
}
0