結果
問題 | No.851 テストケース |
ユーザー |
|
提出日時 | 2019-07-26 22:27:11 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,009 bytes |
コンパイル時間 | 2,145 ms |
コンパイル使用メモリ | 194,568 KB |
最終ジャッジ日時 | 2025-01-07 08:10:18 |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 17 WA * 3 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:14:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 14 | scanf("%*s%*[\n]"); | ~~~~~^~~~~~~~~~~~~ main.cpp:16:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 16 | scanf("%c", &c); | ~~~~~^~~~~~~~~~
ソースコード
#include <bits/stdc++.h>using namespace std;#define INF 1000000000#define MOD 1000000007#define FOR(i, a, b) for(int i = (int)(a); i < (int)(b); i++)#define REP(i, b) FOR(i, 0, b)#define ALL(x) (x).begin(),(x).end()typedef long long ll;int main() {char c;string s;int p[3];scanf("%*s%*[\n]");for(int i = 0; i < 3;){scanf("%c", &c);if(c == ' ') {cout << "\"assert\"" << endl;return 0;}if(c == '\n') {i++;}s += c;}sscanf(&s[0], "%d%d%d", p, p + 1, p + 2);if(p[0] == p[1]) {cout << ((p[0] * 2 < p[0] + p[2]) ? p[0] * 2 : p[0] + p[2]) << endl;return 0;} else {int a[3], q[3];a[0] = p[0] + p[1];a[1] = p[1] + p[2];a[2] = p[2] + p[0];q[0] = a[0] < a[1];q[1] = a[1] < a[2];q[2] = a[2] < a[0];if(q[0] == q[2]) {cout << a[0] << endl;} else if(q[0] == q[1]) {cout << a[1] << endl;} else if(q[1] == q[2]) {cout << a[2] << endl;}}return 0;}