Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int how_many_ways(string map, int N) {
- int t[6];
- int x;
- for(int i=0; i<6; i++)t[i]=1;
- for(int i=1; i<N; i++)
- {
- x=t[i%6];
- t[i%6]=0;
- if(map[i]=='1')
- {
- for(int j=0;j<6;j++)t
- [j]+=x;
- }
- }
- return x;
- }
- int main() {
- int N;
- cin >> N;
- string map;
- cin >> map;
- if (map.size() != N) {
- cout << "Incorrect map size" << endl;
- return -1;
- }
- cout << how_many_ways(map, N) << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement