結果

問題 No.256 桁の数字を入れ替え (2)
ユーザー funakoshifunakoshi
提出日時 2019-08-26 16:01:38
言語 C
(gcc 12.3.0)
結果
TLE  
実行時間 -
コード長 516 bytes
コンパイル時間 123 ms
コンパイル使用メモリ 30,848 KB
実行使用メモリ 10,624 KB
最終ジャッジ日時 2024-04-25 08:33:01
合計ジャッジ時間 3,500 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
10,624 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 TLE -
testcase_03 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include <math.h>
int main(void)
{
    char num[100001]="";
    char max[100001]="";
    scanf("%s",num);
    strcpy(max,num);
    for(int i=0;i<strlen(num)-1;i++)
    {
        for(int j=i+1;j<strlen(num);j++)
        {
            char tmp=num[i];
            num[i]=num[j];
            num[j]=tmp;
            if(strcmp(num,max)>0)
            {
                strcpy(max,num);
            }
        }
    }
    printf("%s",max);
}
0