提出 #29101042


ソースコード 拡げる

#include<stdio.h> 
int bin(int su)
{
  int binary = 0;
  int base = 1;
  while(su>0){
    binary = binary + ( su % 2 ) * base;
    su = su / 2;
    base = base * 10;
  }
  return binary;
}
int main(){
  int i=0,x,y,n,su1,su2;
    scanf("%d",&n);
  while(i<n){
    scanf("%d %d",&x,&y);
    su1=x+y;
    bin(su1);
    su2=x&y;
    bin(su2);
    if(su1==su2)
      printf("yes\n");
    else
      printf("No\n");
    i++;
  }
    return 0;
  }

提出情報

提出日時
問題 D - AND and SUM
ユーザ TCSP
言語 C (GCC 9.2.1)
得点 0
コード長 469 Byte
結果 WA
実行時間 45 ms
メモリ 1620 KiB

コンパイルエラー

./Main.c: In function ‘main’:
./Main.c:15:5: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
   15 |     scanf("%d",&n);
      |     ^~~~~~~~~~~~~~
./Main.c:17:5: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
   17 |     scanf("%d %d",&x,&y);
      |     ^~~~~~~~~~~~~~~~~~~~

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 0 / 400
結果
WA × 2
WA × 13
セット名 テストケース
Sample example0.txt, example1.txt
All 000.txt, 001.txt, 002.txt, 003.txt, 004.txt, 005.txt, 006.txt, 007.txt, 008.txt, 009.txt, 010.txt, example0.txt, example1.txt
ケース名 結果 実行時間 メモリ
000.txt WA 5 ms 1620 KiB
001.txt WA 38 ms 1584 KiB
002.txt WA 13 ms 1588 KiB
003.txt WA 44 ms 1588 KiB
004.txt WA 44 ms 1592 KiB
005.txt WA 43 ms 1580 KiB
006.txt WA 45 ms 1584 KiB
007.txt WA 43 ms 1588 KiB
008.txt WA 44 ms 1508 KiB
009.txt WA 43 ms 1608 KiB
010.txt WA 34 ms 1612 KiB
example0.txt WA 1 ms 1568 KiB
example1.txt WA 1 ms 1512 KiB