結果

問題 No.851 テストケース
ユーザー 👑 CleyL
提出日時 2020-02-25 14:02:26
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 592 bytes
コンパイル時間 746 ms
コンパイル使用メモリ 78,324 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-10-13 12:13:56
合計ジャッジ時間 1,625 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 3 WA * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
  string n;getline(cin,n);
  string s;
  getline(cin,s);
  for(int i = 0; s.size()-1 > i; i++){
    if(!(0 <= s[i] && s[i] <= 9)){
      cout << "\"assert\"" << endl;
      return 0;
    }
  }
  vector<int> A(3);
  A[0] = stoi(s);
  cin>>A[1]>>A[2];
  vector<int> B;
  for(int i = 0; 3 > i; i++){
    for(int j = 0; 3 > j; j++){
      if(i==j)continue;
      B.push_back(A[i]+A[j]);
    }
  }
  sort(B.begin(),B.end());
  B.erase(unique(B.begin(),B.end()),B.end());
  cout << B[B.size()-2] << endl;
}
0