Submission #480275


Source Code Expand

#include <bits/stdc++.h>
using namespace std;

#define rep(i,n) for(int i=0;i<(n);++i)
#define loop for(;;)
#define trace(var) cerr<<">>> "<<#var<<" = "<<var<<endl;
#define inf (1e9)
#define eps (1e-9)
using Integer = long long;
using Real = long double;
const Real PI = acosl(-1);

template<class S, class T> inline
ostream& operator<<(ostream&os, pair<S,T> p) {
  return os << '(' << p.first << ", " << p.second << ')';
}

template<class S, class T, class U> inline
ostream& operator<<(ostream&os, tuple<S,T,U> t) {
  return os << '('
    << get<0>(t) << ", "
    << get<1>(t) << ", "
    << get<2>(t) << ')';
}

template<class T> inline
ostream& operator<<(ostream&os, set<T> v) {
  os << "(set";
  for (T item: v) os << ' ' << item;
  os << ")";
  return os;
}

template<class T> inline
ostream& operator<<(ostream&os, vector<T> v) {
  if (v.size() == 0) { return os << "(empty)"; }
  os << v[0];
  for (int i=1, len=v.size(); i<len; ++i) os << ' ' << v[i];
  return os;
}

template<class T> inline
istream& operator>>(istream&is, vector<T>&v) {
  rep (i, v.size()) is >> v[i];
  return is;
}

//           ^   >  v   <
int dx[] = { -1, 0, 1,  0 };
int dy[] = {  0, 1, 0, -1 };

using vi = vector<int>;
using vvi = vector<vi>;
using vd = vector<double>;
using vvd = vector<vd>;
using vb = vector<bool>;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(0);
  cout.setf(ios::fixed);
  cout.precision(10);
  random_device dev;
  mt19937 rand(dev());

  vi xs(5); cin >> xs;
  vector<int> s;
  rep (i, 5) rep (j, i) rep (k, j) s.push_back(xs[i] + xs[j] + xs[k]);

  sort(begin(s), end(s));
  reverse(begin(s), end(s));
  unique(begin(s), end(s));

  cout << s[2] << endl;

  return 0;
}

Submission Info

Submission Time
Task C - 数を3つ選ぶマン
User cympfh
Language C++11 (GCC 4.9.2)
Score 100
Code Size 1766 Byte
Status AC
Exec Time 29 ms
Memory 932 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 100 / 100
Status
AC × 2
AC × 15
Set Name Test Cases
Sample example_0.txt, example_1.txt
All example_0.txt, example_1.txt, handmade_0.txt, handmade_1.txt, handmade_2.txt, handmade_3.txt, handmade_4.txt, handmade_5.txt, random_0.txt, random_1.txt, random_2.txt, random_3.txt, random_4.txt, example_0.txt, example_1.txt
Case Name Status Exec Time Memory
example_0.txt AC 26 ms 792 KB
example_1.txt AC 24 ms 800 KB
handmade_0.txt AC 26 ms 928 KB
handmade_1.txt AC 25 ms 840 KB
handmade_2.txt AC 25 ms 928 KB
handmade_3.txt AC 25 ms 924 KB
handmade_4.txt AC 25 ms 932 KB
handmade_5.txt AC 24 ms 920 KB
random_0.txt AC 24 ms 808 KB
random_1.txt AC 25 ms 928 KB
random_2.txt AC 26 ms 800 KB
random_3.txt AC 26 ms 808 KB
random_4.txt AC 29 ms 732 KB