제출 #1346148

#제출 시각아이디문제언어결과실행 시간메모리
1346148Faisal_SaqibMobitel (COCI19_mobitel)C++20
컴파일 에러
0 ms0 KiB
#include <iostream>
#include <map>
using namespace std;
#define int long long
const int N=302,mod=1e9+7;
int a[N][N];
map<int,ll> cnt[N][N];
int32_t main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	int r,s,n;
	cin>>r>>s>>n;
	for(int i=1;i<=r;i++)
	{
		for(int j=1;j<=s;j++)
		{
			cin>>a[i][j];
		}
	}
	cnt[1][1][a[1][1]]++;
	for(int i=1;i<=r;i++)
	{
		for(int j=1;j<=s;j++)
		{
			for(auto [w,c]:cnt[i][j-1])
			{
				if(1ll*w*a[i][j]>=n)
				{
					(cnt[i][j][n]+=c)%=mod;
				}
				else
				{
					(cnt[i][j][w*a[i][j]]+=c)%=mod;
				}
			}
			cnt[i][j-1].clear();
			cnt[i-1][j].clear();
			for(auto [w,c]:cnt[i-1][j])
			{
				if(1ll*w*a[i][j]>=n)
				{
					(cnt[i][j][n]+=c)%=mod;
				}
				else
				{
					(cnt[i][j][w*a[i][j]]+=c)%=mod;
				}
			}
		}
	}
	cout<<cnt[r][s][n]<<endl;
}

컴파일 시 표준 에러 (stderr) 메시지

mobitel.cpp:7:9: error: 'll' was not declared in this scope
    7 | map<int,ll> cnt[N][N];
      |         ^~
mobitel.cpp:7:11: error: template argument 2 is invalid
    7 | map<int,ll> cnt[N][N];
      |           ^
mobitel.cpp:7:11: error: template argument 4 is invalid
mobitel.cpp: In function 'int32_t main()':
mobitel.cpp:22:18: error: invalid types 'int[long long int]' for array subscript
   22 |         cnt[1][1][a[1][1]]++;
      |                  ^
mobitel.cpp:27:50: error: 'begin' was not declared in this scope
   27 |                         for(auto [w,c]:cnt[i][j-1])
      |                                                  ^
mobitel.cpp:27:50: note: suggested alternatives:
In file included from /usr/include/c++/13/string:53,
                 from /usr/include/c++/13/bits/locale_classes.h:40,
                 from /usr/include/c++/13/bits/ios_base.h:41,
                 from /usr/include/c++/13/ios:44,
                 from /usr/include/c++/13/ostream:40,
                 from /usr/include/c++/13/iostream:41,
                 from mobitel.cpp:1:
/usr/include/c++/13/bits/range_access.h:114:37: note:   'std::begin'
  114 |   template<typename _Tp> const _Tp* begin(const valarray<_Tp>&) noexcept;
      |                                     ^~~~~
In file included from /usr/include/c++/13/string_view:48,
                 from /usr/include/c++/13/bits/basic_string.h:47,
                 from /usr/include/c++/13/string:54:
/usr/include/c++/13/bits/ranges_base.h:489:44: note:   'std::ranges::__cust::begin'
  489 |     inline constexpr __cust_access::_Begin begin{};
      |                                            ^~~~~
In file included from /usr/include/c++/13/bits/stl_iterator_base_types.h:71,
                 from /usr/include/c++/13/bits/stl_construct.h:61,
                 from /usr/include/c++/13/bits/char_traits.h:57,
                 from /usr/include/c++/13/ios:42:
/usr/include/c++/13/bits/iterator_concepts.h:984:10: note:   'std::ranges::__cust_access::begin'
  984 |     void begin(const auto&) = delete;
      |          ^~~~~
mobitel.cpp:27:50: error: 'end' was not declared in this scope
   27 |                         for(auto [w,c]:cnt[i][j-1])
      |                                                  ^
mobitel.cpp:27:50: note: suggested alternatives:
/usr/include/c++/13/bits/range_access.h:116:37: note:   'std::end'
  116 |   template<typename _Tp> const _Tp* end(const valarray<_Tp>&) noexcept;
      |                                     ^~~
/usr/include/c++/13/bits/ranges_base.h:490:42: note:   'std::ranges::__cust::end'
  490 |     inline constexpr __cust_access::_End end{};
      |                                          ^~~
/usr/include/c++/13/bits/ranges_base.h:137:10: note:   'std::ranges::__cust_access::end'
  137 |     void end(const auto&) = delete;
      |          ^~~
mobitel.cpp:31:51: error: invalid types 'int[long long int]' for array subscript
   31 |                                         (cnt[i][j][n]+=c)%=mod;
      |                                                   ^
mobitel.cpp:38:37: error: request for member 'clear' in 'cnt[i][(j - 1)]', which is of non-class type 'int'
   38 |                         cnt[i][j-1].clear();
      |                                     ^~~~~
mobitel.cpp:39:37: error: request for member 'clear' in 'cnt[(i - 1)][j]', which is of non-class type 'int'
   39 |                         cnt[i-1][j].clear();
      |                                     ^~~~~
mobitel.cpp:40:50: error: 'begin' was not declared in this scope
   40 |                         for(auto [w,c]:cnt[i-1][j])
      |                                                  ^
mobitel.cpp:40:50: note: suggested alternatives:
/usr/include/c++/13/bits/range_access.h:114:37: note:   'std::begin'
  114 |   template<typename _Tp> const _Tp* begin(const valarray<_Tp>&) noexcept;
      |                                     ^~~~~
/usr/include/c++/13/bits/ranges_base.h:489:44: note:   'std::ranges::__cust::begin'
  489 |     inline constexpr __cust_access::_Begin begin{};
      |                                            ^~~~~
/usr/include/c++/13/bits/iterator_concepts.h:984:10: note:   'std::ranges::__cust_access::begin'
  984 |     void begin(const auto&) = delete;
      |          ^~~~~
mobitel.cpp:40:50: error: 'end' was not declared in this scope
   40 |                         for(auto [w,c]:cnt[i-1][j])
      |                                                  ^
mobitel.cpp:40:50: note: suggested alternatives:
/usr/include/c++/13/bits/range_access.h:116:37: note:   'std::end'
  116 |   template<typename _Tp> const _Tp* end(const valarray<_Tp>&) noexcept;
      |                                     ^~~
/usr/include/c++/13/bits/ranges_base.h:490:42: note:   'std::ranges::__cust::end'
  490 |     inline constexpr __cust_access::_End end{};
      |                                          ^~~
/usr/include/c++/13/bits/ranges_base.h:137:10: note:   'std::ranges::__cust_access::end'
  137 |     void end(const auto&) = delete;
      |          ^~~
mobitel.cpp:44:51: error: invalid types 'int[long long int]' for array subscript
   44 |                                         (cnt[i][j][n]+=c)%=mod;
      |                                                   ^
mobitel.cpp:53:24: error: invalid types 'int[long long int]' for array subscript
   53 |         cout<<cnt[r][s][n]<<endl;
      |                        ^