結果
| 問題 | No.3149 find X which satisfies with equlation | 
| コンテスト | |
| ユーザー |  ゆーてぃー | 
| 提出日時 | 2025-05-20 21:35:42 | 
| 言語 | C (gcc 13.3.0) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 387 bytes | 
| コンパイル時間 | 115 ms | 
| コンパイル使用メモリ | 26,064 KB | 
| 実行使用メモリ | 7,848 KB | 
| 最終ジャッジ日時 | 2025-05-20 21:35:45 | 
| 合計ジャッジ時間 | 1,181 ms | 
| ジャッジサーバーID (参考情報) | judge4 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | WA * 3 | 
| other | WA * 44 | 
コンパイルメッセージ
main.c: In function ‘main’:
main.c:9:15: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    9 |         (void)scanf("%d %d",&A,&B);
      |               ^~~~~~~~~~~~~~~~~~~~
            
            ソースコード
#include<stdio.h>
int main(){
	int A,B,X=0,A2[10],B2[10],X2[10],j,two;
	for(int i=0;i<10;i++){
		A2[i]=0;
		B2[i]=0;
		X2[i]=0;
	}
	(void)scanf("%d %d",&A,&B);
	j=9;
	while(A>=2){
		A2[j]=(A%=2);
		A/=2;
		j--;
	}
	
	j=9;
	while(B>=2){
		B2[j]=(B%=2);
		B/=2;
		j--;
	}
	two=1;
	for(int i=10;i>0;i--){
		if(A2[i-1]+B2[i-1]){
			
		}
		X+=two;
		two*=2;
	}
	printf("%d",X);
	
	return 0;
}
            
            
            
        