結果

問題 No.197 手品
ユーザー notetonousnotetonous
提出日時 2016-04-28 23:27:18
言語 C90
(gcc 11.4.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 1,165 bytes
コンパイル時間 168 ms
コンパイル使用メモリ 24,036 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-09-27 09:40:10
合計ジャッジ時間 1,822 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 0 ms
4,376 KB
testcase_04 AC 0 ms
4,376 KB
testcase_05 WA -
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 0 ms
4,376 KB
testcase_08 WA -
testcase_09 AC 0 ms
4,376 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 1 ms
4,376 KB
testcase_12 AC 0 ms
4,380 KB
testcase_13 AC 1 ms
4,376 KB
testcase_14 AC 1 ms
4,380 KB
testcase_15 AC 0 ms
4,376 KB
testcase_16 AC 1 ms
4,380 KB
testcase_17 AC 0 ms
4,376 KB
testcase_18 AC 0 ms
4,376 KB
testcase_19 AC 1 ms
4,376 KB
testcase_20 AC 1 ms
4,376 KB
testcase_21 AC 0 ms
4,376 KB
testcase_22 AC 1 ms
4,380 KB
testcase_23 AC 0 ms
4,380 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 0 ms
4,376 KB
testcase_28 WA -
testcase_29 AC 1 ms
4,380 KB
testcase_30 AC 1 ms
4,376 KB
testcase_31 AC 1 ms
4,380 KB
testcase_32 AC 1 ms
4,376 KB
testcase_33 AC 1 ms
4,380 KB
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 AC 1 ms
4,376 KB
testcase_38 WA -
testcase_39 AC 0 ms
4,376 KB
testcase_40 AC 1 ms
4,376 KB
testcase_41 WA -
testcase_42 AC 1 ms
4,380 KB
testcase_43 AC 1 ms
4,376 KB
testcase_44 AC 1 ms
4,376 KB
testcase_45 AC 1 ms
4,376 KB
testcase_46 AC 1 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
int main(){
  char b[3];
  int n;
  char a[3];
  int i;
  int o=0,p=0;
  scanf("%s",b);
  scanf("%d",&n);
  scanf("%s",a);
  for(i=0;i<3;i++){
    if(b[i]=='o')o++;
    if(a[i]=='o')p++;
  }
  if(o!=p){
    printf("SUCCESS\n");
    return 0;
  }
  if(n==0){
    if(b[0]==a[0] && b[1]==b[1] && b[2]==a[2]){
      printf("FAILURE\n");
      return 0;
    }
    else{
      printf("SUCCESS\n");
      return 0;
    }
  }
  
  if(o==1){
    if(b[1]=='o'){
      if(n==1){
	if(a[1]=='o'){
	  printf("SUCCESS\n");
	}
	else printf("FAILURE\n");
      }
      else {
	printf("FAILURE\n");
      }
    }
    else{
      if(n==1){
	if(b[0]==a[2] && b[2]==a[0])printf("SUCCESS\n");
	else printf("FAILURE\n");
      }
      else {
	printf("FAILURE\n");
      }
    }
  }
  else if(o==2){
    if(b[1]=='x'){
      if(n==1){
	if(a[1]=='x'){
	  printf("SUCCESS\n");
	}
	else printf("FAILURE\n");
      }
      else {
	printf("FAILURE\n");
      }
    }
    else{
      if(n==1){
	if(b[0]==a[2] && b[2]==a[0])printf("SUCCESS\n");
	else printf("FAILURE\n");
      }
      else {
	printf("FAILURE\n");
      }
    }
  }
  else printf("FAILURE\n");
  return 0;
}

0