Submission #98516

# Submission time Handle Problem Language Result Execution time Memory
98516 2019-02-23T20:15:13 Z pamaj Zoltan (COCI16_zoltan) C++14
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;
#define int int64_t
int v[200010];
int n;

set<int> st;

int exp(int x, int y, int p) 
{ 
    int res = 1;
  
    x = x % p; 
    while (y > 0) 
    { 
        if (y & 1) 
            res = (res*x) % p; 
  
        y = y>>1; 
        x = (x*x) % p;   
    } 
    return res; 
} 

int main()
{

	cin >> n;

	for(int i = 0; i < n; i++)
	{
		cin >> v[i];
		st.insert(v[i]);
	}

	vector<int> p;

	for(int i = 0; i < n - 1; i++)
	{
		if(v[i] == v[i + 1]) 
		{
			int cont = 1;
			while(v[i] == v[i + 1])
			{
				cont++;
				i++;
			}
			p.push_back(cont);
		}
	}




	long long ans = 1;

	for(auto u : p)
	{
		ans *= exp(2, u, 1000000007);
		ans %= (1000000007);
	}

	cout << st.size() << " " << ans << "\n";
}

Compilation message

zoltan.cpp:25:10: error: '::main' must return 'int'
 int main()
          ^