結果
| 問題 | No.587 七対子 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-06-21 16:17:11 |
| 言語 | C (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 410 bytes |
| 記録 | |
| コンパイル時間 | 94 ms |
| コンパイル使用メモリ | 28,928 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-30 17:36:39 |
| 合計ジャッジ時間 | 972 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 26 WA * 9 |
コンパイルメッセージ
main.c: In function 'main':
main.c:7:9: warning: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
7 | gets(s);
| ^~~~
| fgets
/usr/bin/ld: /tmp/cc3L63BS.o: in function `main':
main.c:(.text.startup+0x11): 警告: the `gets' function is dangerous and should not be used.
ソースコード
#include <stdio.h>
int main(void)
{
char s[14],t;
int i,j;
gets(s);
for(i=0;i<12;i++){
for(j=12;j>i;j--){
if(s[j-1]>s[j]){
t=s[j-1];
s[j-1]=s[j];
s[j]=t;
}
}
}
for(i=1;i<13;i++){
if(s[i-1]==s[i]&&s[i]==s[i+1]){
puts("Impossible");
return 0;
}
}
for(i=1;i<13;i++){
if(s[i-1]!=s[i]&&s[i]!=s[i+1]){
printf("%c",s[i]);
return 0;
}
}
}