結果
問題 |
No.851 テストケース
|
ユーザー |
![]() |
提出日時 | 2019-07-26 22:04:03 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,252 bytes |
コンパイル時間 | 885 ms |
コンパイル使用メモリ | 71,116 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-02 07:18:07 |
合計ジャッジ時間 | 1,428 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 18 WA * 2 |
ソースコード
#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; } int 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, "%d", &a[i]); } sort(a+0, a+3); int ans=(a[0]==a[1]? a[0]+a[1]: a[0]+a[2]); printf("%d\n", ans); return 0; }