結果
| 問題 |
No.3108 Luke or Bishop
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-04-18 20:54:42 |
| 言語 | C (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| コード長 | 311 bytes |
| コンパイル時間 | 399 ms |
| コンパイル使用メモリ | 24,960 KB |
| 実行使用メモリ | 7,848 KB |
| 最終ジャッジ日時 | 2025-04-18 20:54:47 |
| 合計ジャッジ時間 | 1,050 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 26 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:6:5: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
6 | scanf("%d %d",&g_x,&g_y);
| ^~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h>
#include <stdlib.h>
int main(void){
// Your code here!
int g_x,g_y;
scanf("%d %d",&g_x,&g_y);
if(g_x == 0 && g_y ==0){
printf("0");
}
else if(abs(g_x) == abs(g_y) || g_x == 0 || g_y == 0){
printf("1");
}else{
printf("2");
}
}