結果
| 問題 | No.353 ヘイトプラス |
| コンテスト | |
| ユーザー |
NEEHATOV
|
| 提出日時 | 2020-06-12 03:57:31 |
| 言語 | C(gnu17) (gcc 15.2.0) |
| 結果 |
CE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 340 bytes |
| 記録 | |
| コンパイル時間 | 475 ms |
| コンパイル使用メモリ | 28,544 KB |
| 最終ジャッジ日時 | 2026-02-22 05:53:12 |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
コンパイルメッセージ
main.c: In function 'main':
main.c:9:17: error: implicit declaration of function 'abs' [-Wimplicit-function-declaration]
9 | while (a >> abs(i) != 0) {
| ^~~
main.c:3:1: note: include '<stdlib.h>' or provide a declaration of 'abs'
2 | #include <math.h>
+++ |+#include <stdlib.h>
3 |
ソースコード
#include <stdio.h>
#include <math.h>
int main() {
int a,b,i=0,count=0;
scanf("%d %d",&a, &b);
/* 桁数を計算 */
while (a >> abs(i) != 0) {
if ((a >> abs(i)) & 0x01 && (b >> abs(i)) & 0x01){
count -= (int)pow(2, abs(i)) ;
}
i--;
}
printf("%d\n", (a|b)-count);
return 0;
}
NEEHATOV