結果
問題 | No.851 テストケース |
ユーザー |
![]() |
提出日時 | 2019-07-26 22:05:26 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 3,153 ms |
コード長 | 1,254 bytes |
コンパイル時間 | 1,204 ms |
コンパイル使用メモリ | 70,856 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-02 07:22:12 |
合計ジャッジ時間 | 1,650 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 20 |
ソースコード
#include <stdio.h> #include <string> #include <cstring> #include <stdlib.h> #include <math.h> #include <algorithm> #include <vector> #include <set> #include <map> #include <queue> #include <list> #include <iterator> #include <assert.h> #pragma warning(disable:4996) typedef long long ll; #define MIN(a, b) ((a)>(b)? (b): (a)) #define MAX(a, b) ((a)<(b)? (b): (a)) #define LINF 9223300000000000000 #define INF 2140000000 const long long MOD = 1000000007; using namespace std; int main(int argc, char* argv[]) { char buffer[256]; size_t len; if (fgets(buffer, 256, stdin) == NULL || buffer[0] == '\n') { return 1; } int n; int chk = sscanf(buffer, "%d", &n); if(chk!=1 || n!=3) { return 5; } ll a[3]; int i; for(i=0; i<3; i++) { if (fgets(buffer, 256, stdin) == NULL || buffer[0] == '\n') { return 1; } int len=strlen(buffer); int k; for(k=0; k<len; k++) { if(buffer[k]==' ') { printf("\"assert\"\n"); return 0; } } sscanf(buffer, "%lld", &a[i]); } sort(a+0, a+3); ll ans=(a[0]==a[1]? a[0]+a[1]: a[0]+a[2]); printf("%lld\n", ans); return 0; }