QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#413529#6748. Spin the WheelxiaohongCompile Error//C++20679b2024-05-17 17:53:002024-05-17 17:53:00

Judging History

你现在查看的是最新测评结果

  • [2024-05-17 17:53:00]
  • 评测
  • [2024-05-17 17:53:00]
  • 提交

answer

#include<bits/stdc++.h>
#define IOS cin.tie(0),cout.tie(0),ios::sync_with_stdio(0)
#define int long long
using namespace std;
const int mod=998244353;
int a[100005];
void solve()
{
	int n;
	cin>>n;
	for(int t=1;t<=n;t++)
	{
		cin>>a[t];
	}
	int f=0;
	for(int t=1;t<n;t++)
	{
		if((a[t]-a[t+1]+n)%n!=(a[2]-a[1]+n)%n)
		{
			f=1;break;
		}
	}
	if(f==1)
	{
		cout<"-1\n";return;
	}
	int d=(a[2]-a[1]+n)%n;
	if(d==0)
	{
		if(a[1]==0) cout<<"0\n";
		else cout<<n+1<<endl;
	}
	else
	{
		if(a[1]==0) cout<<d<<endl;
		else cout<<d+1<<endl;
	}
}
signed main()
{
    IOS;
	int T=1;
    cin>>T;
    while(T--)
        solve();
    return 0;
}

Details

answer.code: In function ‘void solve()’:
answer.code:25:21: error: no match for ‘operator<’ (operand types are ‘std::ostream’ {aka ‘std::basic_ostream<char>’} and ‘const char [4]’)
   25 |                 cout<"-1\n";return;
      |                 ~~~~^~~~~~~
      |                 |    |
      |                 |    const char [4]
      |                 std::ostream {aka std::basic_ostream<char>}
In file included from /usr/include/c++/13/regex:68,
                 from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:181,
                 from answer.code:1:
/usr/include/c++/13/bits/regex.h:1288:5: note: candidate: ‘template<class _Bi_iter, class _Ch_traits, class _Alloc> auto std::__cxx11::operator<=>(const sub_match<_BiIter>&, __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)’ (reversed)
 1288 |     operator<=>(const sub_match<_Bi_iter>& __lhs,
      |     ^~~~~~~~
/usr/include/c++/13/bits/regex.h:1288:5: note:   template argument deduction/substitution failed:
answer.code:25:22: note:   mismatched types ‘const std::__cxx11::sub_match<_BiIter>’ and ‘const char [4]’
   25 |                 cout<"-1\n";return;
      |                      ^~~~~~
/usr/include/c++/13/bits/regex.h:1456:5: note: candidate: ‘template<class _Bi_iter> auto std::__cxx11::operator<=>(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)’ (reversed)
 1456 |     operator<=>(const sub_match<_Bi_iter>& __lhs,
      |     ^~~~~~~~
/usr/include/c++/13/bits/regex.h:1456:5: note:   template argument deduction/substitution failed:
answer.code:25:22: note:   mismatched types ‘const std::__cxx11::sub_match<_BiIter>’ and ‘const char [4]’
   25 |                 cout<"-1\n";return;
      |                      ^~~~~~
/usr/include/c++/13/bits/regex.h:1629:5: note: candidate: ‘template<class _Bi_iter> auto std::__cxx11::operator<=>(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)’ (reversed)
 1629 |     operator<=>(const sub_match<_Bi_iter>& __lhs,
      |     ^~~~~~~~
/usr/include/c++/13/bits/regex.h:1629:5: note:   template argument deduction/substitution failed:
answer.code:25:22: note:   mismatched types ‘const std::__cxx11::sub_match<_BiIter>’ and ‘const char [4]’
   25 |                 cout<"-1\n";return;
      |                      ^~~~~~
In file included from /usr/include/c++/13/bits/stl_algobase.h:67,
                 from /usr/include/c++/13/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:51:
/usr/include/c++/13/bits/stl_iterator.h:583:5: note: candidate: ‘template<class _IteratorL, class _IteratorR>  requires  three_way_comparable_with<_IteratorR, _IteratorL, std::partial_ordering> constexpr std::compare_three_way_result_t<_IteratorL, _IteratorR> std::operator<=>(const reverse_iterator<_IteratorL>&, const reverse_iterator<_IteratorR>&)’ (reversed)
  583 |     operator<=>(const reverse_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/include/c++/13/bits/stl_iterator.h:583:5: note:   template argument deduction/substitution failed:
answer.code:25:22: note:   mismatched types ‘const std::reverse_iterator<_IteratorL>’ and ‘const char [4]’
   25 |                 cout<"-1\n";return;
      |                      ^~~~~~
/usr/include/c++/13/bits/stl_iterator.h:1690:5: note: candidate: ‘template<class _IteratorL, class _IteratorR>  requires  three_way_comparable_with<_IteratorR, _IteratorL, std::partial_ordering> constexpr std::compare_three_way_result_t<_IteratorL, _IteratorR> std::operator<=>(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)’ (reversed)
 1690 |     operator<=>(const move_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/include/c++/13/bits/stl_iterator.h:1690:5: note:   template argument deduction/substitution failed:
answer.code:25:22: note:   mismatched types ‘const std::move_iterator<_IteratorL>’ and ‘const char [4]’
   25 |                 cout<"-1\n";return;
      |                      ^~~~~~
In file included from /usr/include/c++/13/bits/basic_string.h:47,
                 from /usr/include/c++/13/string:54,
                 from /usr/include/c++/13/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:52:
/usr/include/c++/13/string_view:632:5: note: candidate: ‘template<class _CharT, class _Traits> constexpr decltype (__char_traits_cmp_cat<_Traits>(0)) std::operator<=>(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)’ (reversed)
  632 |     operator<=>(basic_string_view<_CharT, _Traits> __x,
      |     ^~~~~~~~
/usr/include/c++/13/string_view:632:5: note:   template argument deduction/substitution failed:
answer.code:25:22: note:   mismatched types ‘std::basic_string_view<_CharT, _Traits>’ and ‘const char*’
   25 |                 cout<"-1\n";return;
      |                      ^~~~~~
/usr/include/c++/13/bits/basic_string.h:3748:5: note: candidate: ‘template<class _CharT, class _Traits, class _Alloc> conste...