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