結果

問題 No.197 手品
ユーザー 184
提出日時 2015-04-28 23:40:57
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 494 bytes
コンパイル時間 429 ms
コンパイル使用メモリ 40,544 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-27 07:16:53
合計ジャッジ時間 1,441 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 32 WA * 11
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:10:39: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   10 |         char s1[10],s2[10];int n;scanf("%s%d%s",s1,&n,s2);
      |                                  ~~~~~^~~~~~~~~~~~~~~~~~~

ソースコード

diff #

#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <map>


using namespace std;

int main(){ 
	char s1[10],s2[10];int n;scanf("%s%d%s",s1,&n,s2);
	int cnt1=0,cnt2=0;
	int dcnt=0;
	for(int i=0;i<3;i++){
		if(s1[i]=='o')cnt1++;
		if(s2[i]=='o')cnt2++;
		if(s1[i]!=s2[i])dcnt++;
	}
	if(cnt1!=cnt2)printf("SUCCESS\n");
	else if(cnt1==3||dcnt==0)printf("FAILURE\n");
	else if(dcnt==2){
		if(n%2)printf("SUCCESS\n");
		else printf("FAILURE\n");
	}
	//printf("%d\n",ans); 
	return 0;
}
0