結果

問題 No.3032 Unavailability of Inequality Signs
ユーザー hirakich1000000007hirakich1000000007
提出日時 2018-12-25 23:26:51
言語 C
(gcc 12.3.0)
結果
TLE  
実行時間 -
コード長 444 bytes
コンパイル時間 236 ms
コンパイル使用メモリ 29,056 KB
実行使用メモリ 15,304 KB
最終ジャッジ日時 2024-04-09 02:48:30
合計ジャッジ時間 7,058 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

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