Submission #3604812
Source Code Expand
#include <iostream> #include <string> #include <vector> #include <set> using namespace std; set<string> s; string solveMeFirst(vector<string> list){ for (int i = 0; i<list.size()-1; i++){ if (!(list[i].back() == list[i+1].front() && !s.find(list[i]))){ return "No"; } return "Yes"; } } int main(){ int a; string b; vector<string> c; cin >> a ; while(cin >> b){ c.push_back(b); } string d = solveMeFirst(c); cout << d; return 0; }
Submission Info
Submission Time | |
---|---|
Task | B - Shiritori |
User | vjudge4 |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 517 Byte |
Status | CE |
Compile Error
./Main.cpp: In function ‘std::string solveMeFirst(std::vector<std::basic_string<char> >)’: ./Main.cpp:9:54: error: no match for ‘operator!’ (operand type is ‘std::set<std::basic_string<char> >::iterator {aka std::_Rb_tree_const_iterator<std::basic_string<char> >}’) if (!(list[i].back() == list[i+1].front() && !s.find(list[i]))){ ^ ./Main.cpp:9:54: note: candidate: operator!(bool) <built-in> ./Main.cpp:9:54: note: no known conversion for argument 1 from ‘std::set<std::basic_string<char> >::iterator {aka std::_Rb_tree_const_iterator<std::basic_string<char> >}’ to ‘bool’