結果
| 問題 |
No.587 七対子
|
| コンテスト | |
| ユーザー |
Haijinn
|
| 提出日時 | 2018-02-08 17:38:36 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 587 bytes |
| コンパイル時間 | 121 ms |
| コンパイル使用メモリ | 21,376 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-09-24 17:20:57 |
| 合計ジャッジ時間 | 1,010 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 25 WA * 10 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:13:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
13 | scanf("%s",s);
| ^~~~~~~~~~~~~
ソースコード
#include <stdio.h>
#include <string.h>
int main(void)
{
char s[20];
int i,j;
int x[20];
int c=0;
int q=0;
int a=0;
int l;
char temp;
scanf("%s",s);
l=strlen(s);
for(i=0;i<l;i++){
for(j=0;j<l;j++){
if(s[i]==s[j]){
c++;
}
}
x[i]=c;
c=0;
}
for(i=0;i<l;i++){
if(x[i]%2!=0&&x[i]<3){
q++;
temp=s[i];
//printf("%d%c\n",x[i],temp);
}
/*if(l-1==i&&q==1){
prin
}*/
}
if(q==1&&l+1<=13){
printf("%c\n",temp);
}else{
printf("Impossible\n");
}
return 0;
}
Haijinn