結果
| 問題 | No.256 桁の数字を入れ替え (2) |
| コンテスト | |
| ユーザー |
Haijinn
|
| 提出日時 | 2017-03-31 21:00:35 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 437 bytes |
| 記録 | |
| コンパイル時間 | 120 ms |
| コンパイル使用メモリ | 21,504 KB |
| 実行使用メモリ | 10,624 KB |
| 最終ジャッジ日時 | 2024-07-07 04:47:42 |
| 合計ジャッジ時間 | 3,455 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 2 TLE * 1 -- * 1 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:14:1: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
14 | scanf("%s",s);
| ^~~~~~~~~~~~~
ソースコード
#include <stdio.h>
#include<stdlib.h>
#include<string.h>
int main(void)
{
int n;
int h;
int m;
int t;
int q;
int z;
int temp;
char s[100000];
scanf("%s",s);
for(h=0;h<strlen(s);h++){
for(m=strlen(s)-1;m>h;m--){
if(s[m]<s[m-1]){
temp=s[m-1];
s[m-1]=s[m];
s[m]=temp;
}
}
}
for(h=strlen(s)-1;h>=0;h--){
printf("%c",s[h]);
}
printf("\n");
return 0;
}
Haijinn