提出 #76889845
ソースコード 拡げる
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define rrep(i, a, b) for (int i = (a); i < (b); ++i)
using namespace std;
using ll=long long;
using vi=vector<int>;
using pii=pair<int,int>;
using ma=map<string,int>;//昇順
using md=map<string,int,greater<string>>;//降順
using si=set<int>;
using usi=unordered_set<int>;
template<class Container>
void input(Container& a){
for(auto &x : a) cin >> x;
}
template<class T>
void prepare(unordered_set<T>& st, int n){
st.reserve(n);
st.max_load_factor(0.7);
}
long long modfix(long long a, long long m){
return (a % m + m) % m;
}
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
string a[4]={"ARC","AGC","ABC","AHC"};
bool b[4]={true,true,true,true};
rep(i,4)
{
string c;
cin>>c;
auto it = find(a.begin(), a.end(), c);
if (it != a.end()) {
int idx = distance(a.begin(), it);
b[idx] = false;
}
}
rep(i,4)
{
if(b[i])
cout<<b[i];
}
}
提出情報
| 提出日時 | |
|---|---|
| 問題 | C - AtCoder Quiz |
| ユーザ | kaidesi |
| 言語 | C++23 (GCC 15.2.0) |
| 得点 | 0 |
| コード長 | 1084 Byte |
| 結果 | CE |
コンパイルエラー
./Main.cpp: In function 'int main()':
./Main.cpp:41:22: error: request for member 'begin' in 'a', which is of non-class type 'std::string [4]' {aka 'std::__cxx11::basic_string<char> [4]'}
41 | auto it = find(a.begin(), a.end(), c);
| ^~~~~
./Main.cpp:41:33: error: request for member 'end' in 'a', which is of non-class type 'std::string [4]' {aka 'std::__cxx11::basic_string<char> [4]'}
41 | auto it = find(a.begin(), a.end(), c);
| ^~~
./Main.cpp:42:21: error: request for member 'end' in 'a', which is of non-class type 'std::string [4]' {aka 'std::__cxx11::basic_string<char> [4]'}
42 | if (it != a.end()) {
| ^~~
./Main.cpp:43:34: error: request for member 'begin' in 'a', which is of non-class type 'std::string [4]' {aka 'std::__cxx11::basic_string<char> [4]'}
43 | int idx = distance(a.begin(), it);
| ^~~~~