結果
問題 |
No.965 門松列が嫌い
|
ユーザー |
![]() |
提出日時 | 2020-01-13 21:08:49 |
言語 | C (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 1,000 ms |
コード長 | 490 bytes |
コンパイル時間 | 678 ms |
コンパイル使用メモリ | 28,928 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-22 21:01:43 |
合計ジャッジ時間 | 776 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 9 |
ソースコード
// yuki 965 門松列が嫌い // 2019.1.13 bal4u #include <stdio.h> int getchar_unlocked(void); #define gc() getchar_unlocked() int in() { // 非負整数の入力 int n = 0, c = gc(); do n = 10 * n + (c & 0xf); while ((c = gc()) >= '0'); return n; } #define ABS(a) ((a)>=0?(a):-(a)) #define MIN(a,b) ((a)<=(b)?(a):(b)) int main() { int A, B, C, ans; A = in(), B = in(), C = in(); ans = MIN(ABS(A-B), ABS(B-C)); ans = MIN(ans, ABS(A-C)); printf("%d\n", ans); return 0; }