結果
問題 | No.965 門松列が嫌い |
ユーザー |
![]() |
提出日時 | 2020-01-13 21:39:24 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 20 ms / 1,000 ms |
コード長 | 613 bytes |
コンパイル時間 | 2,116 ms |
コンパイル使用メモリ | 198,232 KB |
最終ジャッジ日時 | 2025-01-08 17:45:41 |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 9 |
ソースコード
#include <bits/stdc++.h> using namespace std; using ll = long long; using pii = pair<int, int>; using vi = vector<int>; using vl = vector<ll>; #define rep(i, n) for(ll i = 0;i < n;i++) #define all(i) i.begin(), i.end() template<class T, class U> bool cmax(T& a, U b) { if (a<b) {a = b; return true;} else return false; } template<class T, class U> bool cmin(T& a, U b) { if (a>b) {a = b; return true;} else return false; } int main() { cin.tie(0); ios::sync_with_stdio(false); constexpr ll n = 3; vl a(n); rep(i, n) { cin >> a[i]; } sort(all(a)); cout << min(a[2]-a[1], a[1]-a[0]) << endl; }