結果
問題 |
No.2691 Longest Infection Sequence
|
ユーザー |
![]() |
提出日時 | 2024-03-22 21:24:58 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 1,322 bytes |
コンパイル時間 | 3,460 ms |
コンパイル使用メモリ | 228,376 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-09-30 13:21:52 |
合計ジャッジ時間 | 3,976 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 14 |
ソースコード
#include <bits/stdc++.h> using namespace std; #include <atcoder/all> using namespace atcoder; using ll = long long; #define all(x) (x).begin(), (x).end() template <typename T, typename U> ostream &operator<<(ostream &os, const pair<T, U> &p) { os << p.first << ' ' << p.second; return os; } template <typename T, typename U> istream &operator>>(istream &is, pair<T, U> &p) { is >> p.first >> p.second; return is; } template <typename T> ostream &operator<<(ostream &os, const vector<T> &v) { ll s = (ll)v.size(); for (ll i = 0; i < s; i++) os << (i ? ' ' : ' ') << v[i]; return os; } template <typename T> istream &operator>>(istream &is, vector<T> &v) { for (auto &x : v) is >> x; return is; } //エラトステネスのふるい bool IsPrime(ll num) { if (num < 2) return false; else if (num == 2) return true; else if (num % 2 == 0) return false; // 偶数はあらかじめ除く double sqrtNum = sqrt(num); for (int i = 3; i <= sqrtNum; i += 2) { if (num % i == 0) { // 素数ではない return false; } } // 素数である return true; } #define rep(i, n) for (ll (i) = 0; (i) < (ll)(n); (i)++) int main() { ll a,b,o,ab; cin >> a >> b >> o >> ab; cout << o+max(a,b)+ab << endl; }