結果

問題 No.851 テストケース
ユーザー r1933r1933
提出日時 2019-07-26 21:57:18
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 5,129 bytes
コンパイル時間 1,657 ms
コンパイル使用メモリ 171,500 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-09-15 01:18:39
合計ジャッジ時間 2,694 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 2 ms
4,376 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 2 ms
4,380 KB
testcase_18 WA -
testcase_19 AC 2 ms
4,376 KB
testcase_20 AC 2 ms
4,376 KB
testcase_21 WA -
testcase_22 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>                                                                      
                                                                                              
using namespace std;                                                                          
                                                                                              
#define all(x) x.begin(), x.end()                                                             
#define rep(i, n) for (int i = 0; i < n; ++i)                                                 
#define reps(i, m, n) for (int i = m; i <= n; ++i)                                            
                                                                                              
using i64 = long long;                                                                        
using pii = pair<i64, i64>;                                                                   
                                                                                              
template<class A, class B>inline bool chmax(A &a, const B &b){return b > a ? a = b,1 : 0;}    
template<class A, class B>inline bool chmin(A &a, const B &b){return b < a ? a = b,1 : 0;}    
                                                                                              
constexpr int INF = 0x3f3f3f3f;                                                               
constexpr i64 LINF = 0x3f3f3f3f3f3f3f3fLL;                                                    
constexpr int mod = int(1e9) + 7;                                                             
                                                                                              
signed main()                                                                                 
{                                                                                             
  ios::sync_with_stdio(false);                                                                
  cin.tie(nullptr);                                                                           
  int N;                                                                                      
  cin >> N;                                                                                   
  cin.ignore();                                                                               
  string s;                                                                                   
  getline(cin, s);                                                                            
  for (auto e : s) {                                                                          
    if (e == ' ') {                                                                           
      cout << '"' <<  "assert" << '"' << "\n";                                                
      return 0;                                                                               
    }                                                                                         
  }                                                                                           
                                                                                              
  s.clear();                                                                                  
                                                                                              
  vector<int> vec;                                                                            
  i64 a[4];                                                                                   
  rep(i, N) {                                                                                 
    cin >> a[i];                                                                              
  }                                                                                           
  int case1 = a[0] + a[1];                                                                    
  int case2 = a[1] + a[2];                                                                    
  int case3 = a[0] + a[2];                                                                    
                                                                                              
  vec.push_back(case1);                                                                       
  vec.push_back(case2);                                                                       
  vec.push_back(case3);                                                                       
                                                                                              
  sort(all(vec), greater<int>());                                                             
                                                                                              
  cout << (vec[0] == vec[1] ? vec[2] : vec[1]) << "\n";                                       
  return 0;                                                                                   
}                                                                                             
0