結果
| 問題 |
No.965 門松列が嫌い
|
| コンテスト | |
| ユーザー |
Maeda
|
| 提出日時 | 2025-03-28 17:13:54 |
| 言語 | C (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 1,000 ms |
| コード長 | 565 bytes |
| コンパイル時間 | 386 ms |
| コンパイル使用メモリ | 24,192 KB |
| 実行使用メモリ | 7,324 KB |
| 最終ジャッジ日時 | 2025-03-28 17:13:55 |
| 合計ジャッジ時間 | 1,203 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 9 |
コンパイルメッセージ
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("%ld %ld %ld",&a,&b,&c);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h>
void main(void) {
long int a,b,c;
scanf("%ld %ld %ld",&a,&b,&c);
long int patternA = b-a;
if(patternA < 0){
patternA *= -1;
}
long int patternB = b-c;
if(patternB < 0){
patternB *= -1;
}
long int patternC = a-c;
if(patternC < 0){
patternC *= -1;
}
if(patternA <= patternB && patternA <= patternC){
printf("%ld",patternA);
}else if(patternB <= patternA && patternB <= patternC){
printf("%ld",patternB);
}else{
printf("%ld",patternC);
}
}
Maeda