結果
| 問題 |
No.998 Four Integers
|
| コンテスト | |
| ユーザー |
toto
|
| 提出日時 | 2025-04-01 17:11:00 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 1,000 ms |
| コード長 | 414 bytes |
| コンパイル時間 | 583 ms |
| コンパイル使用メモリ | 27,520 KB |
| 実行使用メモリ | 7,324 KB |
| 最終ジャッジ日時 | 2025-04-01 17:11:02 |
| 合計ジャッジ時間 | 1,376 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 23 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:7:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
7 | scanf("%d",&arr[i]);
| ~~~~~^~~~~~~~~~~~~~
ソースコード
#include <stdio.h>
int main(){
int arr[4];
for(int i = 0;i < 4;i ++){
scanf("%d",&arr[i]);
}
// バブルソート(昇順)
for(int i = 0;i < 4;i ++){
for(int j = 0;j < 4;j ++){
if(arr[i] < arr[j]){
int tmp = arr[i];
arr[i] = arr[j];
arr[j] = tmp;
}
}
}
if(arr[0] + 1 == arr[1] && arr[0] + 2 == arr[2] && arr[0] + 3 == arr[3]){
printf("Yes");
}else{
printf("No");
}
}
toto