結果
| 問題 |
No.851 テストケース
|
| コンテスト | |
| ユーザー |
mmn15277198
|
| 提出日時 | 2020-09-01 22:02:53 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 3,153 ms |
| コード長 | 864 bytes |
| コンパイル時間 | 1,144 ms |
| コンパイル使用メモリ | 99,828 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-11-20 18:39:04 |
| 合計ジャッジ時間 | 2,332 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 20 |
ソースコード
#include<iostream>
#include<stdio.h>
#include<stdlib.h>
#include<algorithm>
#include<vector>
#include<string.h>
#include<math.h>
#include<map>
#include<iomanip>
#include<queue>
using namespace std;
long long s_to_ll(string s){
long long res=0;
for(int i=0;i<s.size();i++){
res+=(long long)(s[i]-'0');
res*=10;
}
res/=10;
//cout << res << endl;
return res;
}
int main(){
int n;
cin >> n;
vector<long long> a;
string skip,t;
getline(cin,skip);
for(int i=0;i<=n;i++){
if(i==0)continue;
getline(cin,t);
for(int j=0;j<t.size();j++){
if(t[j]>'9' || '0'>t[j]){
cout << '"' << "assert" << '"' << endl;
return 0;
}
}
a.push_back(s_to_ll(t));
}
vector<long long> b(n);
b[0]=a[0]+a[1];
b[1]=a[0]+a[2];
b[2]=a[1]+a[2];
sort(b.begin(),b.end());
if(b[2]>b[1])cout << b[1] << endl;
else cout << b[0] << endl;
return 0;
}
mmn15277198