結果
| 問題 |
No.998 Four Integers
|
| コンテスト | |
| ユーザー |
rsk0315
|
| 提出日時 | 2020-02-28 21:23:31 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 1,000 ms |
| コード長 | 280 bytes |
| コンパイル時間 | 565 ms |
| コンパイル使用メモリ | 57,152 KB |
| 最終ジャッジ日時 | 2025-01-09 02:31:30 |
|
ジャッジサーバーID (参考情報) |
judge4 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 23 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:7:26: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
7 | for (auto& ai: a) scanf("%d", &ai);
| ~~~~~^~~~~~~~~~~
ソースコード
#include <cstdio>
#include <algorithm>
#include <vector>
int main() {
std::vector<int> a(4);
for (auto& ai: a) scanf("%d", &ai);
std::sort(a.begin(), a.end());
if (std::unique(a.begin(), a.end()) != a.end()) return puts("No"), 0;
puts((a[3]-a[0] == 3)? "Yes": "No");
}
rsk0315