結果
| 問題 | No.24 数当てゲーム |
| コンテスト | |
| ユーザー |
Kutimoti_T
|
| 提出日時 | 2017-12-18 20:54:11 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
CE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 687 bytes |
| 記録 | |
| コンパイル時間 | 252 ms |
| コンパイル使用メモリ | 59,632 KB |
| 最終ジャッジ日時 | 2026-05-26 06:48:07 |
| 合計ジャッジ時間 | 1,109 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_1 |
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:24:32: error: reference to 'get' is ambiguous
24 | cin >> get[j];
| ^~~
In file included from /home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/bits/stl_algobase.h:64,
from /home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/string:53,
from /home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/bits/locale_classes.h:42,
from /home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/bits/ios_base.h:43,
from /home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/ios:46,
from /home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/bits/ostream.h:43,
from /home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/ostream:42,
from /home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/iostream:43,
from main.cpp:1:
/home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/bits/stl_pair.h:153:5: note: candidates are: 'template<long unsigned int _Int, class _Tp, long unsigned int _Nm> constexpr const _Tp&& std::get(const array<_Tp, _Nm>&&)'
153 | get(const array<_Tp, _Nm>&&) noexcept;
| ^~~
/home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/bits/stl_pair.h:149:5: note: 'template<long unsigned int _Int, class _Tp, long unsigned int _Nm> constexpr const _Tp& std::get(const array<_Tp, _Nm>&)'
149 | get(const array<_Tp, _Nm>&) noexcept;
| ^~~
/home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/bits/stl_pair.h:145:5: note: 'template<long unsigned int _Int, class _Tp, long unsigned int _Nm> constexpr _Tp&& std::get(array<_Tp, _Nm>&&)'
145 | get(array<_Tp, _Nm>&&) noexcept;
| ^~~
/home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/bits/stl_pair.h:141:5: note:
ソースコード
#include <iostream>
#include <string>
using namespace std;
int memo[10];
int N;
int get[4];
int main()
{
for(int i = 0;i <=9;i++)
{
memo[i] = true;
}
int a,b,c,d;
string r;
cin >> N;
for(int i = 0;i < N;i++)
{
for(int j = 0;j < 4;j++)
{
cin >> get[j];
}
cin >> r;
if(r=="YES")
{
for(int k = 0;k <= 9;k++)
{
bool same = false;
for(int j=0;j<4;j++)
{
if(k == get[j]) same = true;
}
if(same == false)
{
memo[k] = false;
}
}
}
else
{
for(int j = 0;j < 4;j++)
{
memo[get[j]] = false;
}
}
}
for(int i = 0;i <= 9;i++)
{
if(memo[i])
{
cout << i << endl;
return 0;
}
}
return 0;
}
Kutimoti_T