Submission #3781647


Source Code Expand

#include<bits/stdc++.h>
using namespace std;
int main() {
	string S;
	cin >> S;
	if (S.size() == 1) {
		if (S == 'a') cout << -1 << endl;
		else cout << "a" << endl;
	}
	else {
		cout << "a" << endl;
	}
	return 0;
}

Submission Info

Submission Time
Task B - 辞書式順序
User ikedayuu
Language C++14 (GCC 5.4.1)
Score 0
Code Size 230 Byte
Status CE

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:7:9: error: no match for ‘operator==’ (operand types are ‘std::string {aka std::basic_string<char>}’ and ‘char’)
   if (S == 'a') cout << -1 << endl;
         ^
In file included from /usr/include/c++/5/unordered_set:48:0,
                 from /usr/include/x86_64-linux-gnu/c++/5/bits/stdc++.h:116,
                 from ./Main.cpp:1:
/usr/include/c++/5/bits/unordered_set.h:1421:5: note: candidate: template<class _Value, class _Hash, class _Pred, class _Alloc> bool std::operator==(const std::unordered_multiset<_Value, _Hash, _Pred, _Alloc>&, const std::unordered_multiset<_Value, _Hash, _Pred, _Alloc>&)
     operator==(const unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __x,
     ^
/usr/include/c++/5/bits/unordered_set.h:1421:5: note:   template argument deduction/substitution failed:
./Main.cpp:7:12: note:   ‘std::string {aka std::basic_string<char>}’ is not derived from ‘const std::unordered_multiset<_Value, _Hash, _Pred, _Alloc>’
   if (S == 'a') cout << -...