結果
問題 |
No.3150 count X which satisfies with equlation
|
ユーザー |
![]() |
提出日時 | 2025-05-20 21:23:44 |
言語 | C (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 2,000 ms |
コード長 | 243 bytes |
コンパイル時間 | 819 ms |
コンパイル使用メモリ | 26,196 KB |
実行使用メモリ | 6,272 KB |
最終ジャッジ日時 | 2025-06-20 02:57:15 |
合計ジャッジ時間 | 2,103 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 42 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:5:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 5 | scanf("%d %d", &a, &b); | ^~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include<stdio.h> int main() { int a, b; scanf("%d %d", &a, &b); int ans = 1; while (a > 0 || b > 0) { if (a % 2 > 0) { if (b % 2 > 0) ans *= 2; else ans = 0; } a /= 2; b /= 2; } printf("%d\n", ans); return 0; }