結果

問題 No.3032 Unavailability of Inequality Signs
ユーザー hirakich1000000007hirakich1000000007
提出日時 2018-12-25 23:28:27
言語 C
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 461 bytes
コンパイル時間 341 ms
コンパイル使用メモリ 29,696 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-09 02:48:32
合計ジャッジ時間 1,764 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 1 ms
6,944 KB
testcase_03 WA -
testcase_04 AC 1 ms
6,944 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c:11:1: warning: return type defaults to 'int' [-Wimplicit-int]
   11 | main(){
      | ^~~~
main.c: In function 'main':
main.c:13:5: warning: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   13 |     scanf("%d", &n);
      |     ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | int issmaller (int a, int b) {
main.c:13:5: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   13 |     scanf("%d", &n);
      |     ^~~~~
main.c:13:5: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:18:13: warning: implicit declaration of function 'putchar' [-Wimplicit-function-declaration]
   18 |             putchar('=');
      |             ^~~~~~~
main.c:18:13: note: include '<stdio.h>' or provide a declaration of 'putchar'

ソースコード

diff #

int issmaller (int a, int b) {
    int h = 1073741824;
    while (h) {
        if (!(a & h) && (b & h)) return 1;
        if ((a & h) && !(b & h)) return 0;
        h /= 2;
    }
    return 0;
}

main(){
    int n;
    scanf("%d", &n);
    while (n--) {
        int a, b;
        scanf("%d%d", &a, &b);
        if (a == b) {
            putchar('=');
        } else {
            putchar(issmaller(a, b) ? 0x3c : 0x3b);
        }
        putchar('\n');
    }
}
0