結果
| 問題 | No.1934 Four Fruits |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-05-20 20:14:09 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 820 bytes |
| 記録 | |
| コンパイル時間 | 1,331 ms |
| コンパイル使用メモリ | 180,436 KB |
| 実行使用メモリ | 7,972 KB |
| 最終ジャッジ日時 | 2026-04-08 17:21:19 |
| 合計ジャッジ時間 | 2,805 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 1 |
| other | AC * 7 |
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:5:23: warning: ignoring return value of 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::begin() [with _Tp = int; _Alloc = std::allocator<int>; iterator = std::vector<int>::iterator]', declared with attribute 'nodiscard' [-Wunused-result]
5 | #define all(c) c.begin(),c.end()
| ^
main.cpp:25:5: note: in expansion of macro 'all'
25 | all(A);
| ^~~
In file included from /home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/vector:68,
from /home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/queue:69,
from /home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/x86_64-pc-linux-gnu/bits/stdc++.h:160,
from main.cpp:1:
/home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/bits/stl_vector.h:998:7: note: declared here
998 | begin() _GLIBCXX_NOEXCEPT
| ^~~~~
ソースコード
#include <bits/stdc++.h>
#include <regex>
using namespace std;
using ll = int64_t;
#define all(c) c.begin(),c.end()
#define rall(c) c.rbegin(),c.rend()
// -------------------------------
// 2022/5/20 Hiroyuki Yamanouchi
// AtCoder Rating 187 10級
// -------------------------------
// void chmax(ll& a, ll b){ if(a < b) a = b; }
// void chmin(ll& a, ll b){ if(a > b) a = b; }
// for (int i = 0; i < N; i++){
// cin >> P[i];
// }
int main() {
vector<int> A(3);
cin >> A[0] >> A[1] >> A[2] ;
all(A);
int ans;
if (A[0] == A[1] && A[1] == A[2]) ans = A[0];
else if (A[0] == A[1] && A[1] != A[2]) ans = A[2];
else if (A[0] != A[1] && A[1] == A[2]) ans = A[0];
else if (A[0] != A[1] && A[1] != A[2]) ans = 6 -(A[0]+A[1]+A[2]);
cout << ans << endl;
return 0;
}