結果
| 問題 | 
                            No.851 テストケース
                             | 
                    
| コンテスト | |
| ユーザー | 
                             toyama
                         | 
                    
| 提出日時 | 2019-07-26 21:41:03 | 
| 言語 | C++14  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 673 bytes | 
| コンパイル時間 | 555 ms | 
| コンパイル使用メモリ | 64,788 KB | 
| 実行使用メモリ | 6,944 KB | 
| 最終ジャッジ日時 | 2024-07-02 06:48:06 | 
| 合計ジャッジ時間 | 1,470 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge3 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 11 WA * 9 | 
ソースコード
#include <iostream>
#include <cstdio>
using namespace std;
using ll = long long;
int main()
{
    ll n;
    ll a[3];
    ll line = 0;
    scanf("%lld", &n);
    for (int i = 0; i < n; i++) {
        scanf("%lld", a + i); 
        char ch = getchar();
        if (ch == '\n') {
            line++;
        }
    }
    if (line <= 1) {
        puts("\"assert\"");
        return 0;
    }
    ll max1 = 0, max2 = 0;
    for (int i = 0; i < n; i++) {
        for (int j = i + 1; j < n; j++) {
            if (max1 < a[i] + a[j]) {
                max2 = max1;
                max1 = a[i] + a[j];
            }
        }
    }
    cout << max2 << endl;
    return 0;
}
            
            
            
        
            
toyama