Submission #86669

# Submission time Handle Problem Language Result Execution time Memory
86669 2018-11-27T05:02:56 Z Pluton Calvinball championship (CEOI15_teams) C++14
10 / 100
30 ms 876 KB
#include <bits/stdc++.h>

#define ld long double
#define ll long long
#define sz size()
#define all(xx) xx.begin(),xx.end()
#define pb push_back
#define in insert
#define er erase
#define S second
#define F first
#define pii pair <int, int>
#define to_be continue
#define mp make_pair
#define stop exit (0)
#define fname ""
#define speed ios_base::sync_with_stdio(0);cin.tie(0)
#define input freopen (fname".in", "r", stdin)
#define output freopen (fname".out", "w", stdout)
#define int ll
#define N 300000

using namespace std;

const int inf = 1e9 + 123;
const ll INF = 1e18 + 123;
const double pi = acos (-1.0);
const ld eps = 1e-3;

int n, ans = 1, cur[N], a[N];

main ()
{
	speed;
	cin >> n;
	for (int i = 1; i <= n; i ++)
		cur[i] = 1;
	for (int i = 1; i <= n; i ++)
	{
		cin >> a[i];
		if (a[i] != cur[i])
		{
			ans += (a[i] - cur[i]) * (pow (3, n - i));
			for (int j = i + 1; j <= n; j ++)
				cur[j] = a[i];
		}
	}
	cout << ans;
}
//Coded by A....

Compilation message

teams.cpp:32:7: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
 main ()
       ^
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 3 ms 376 KB Output is correct
3 Correct 2 ms 448 KB Output is correct
4 Correct 2 ms 592 KB Output is correct
5 Correct 2 ms 592 KB Output is correct
6 Correct 2 ms 640 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3 ms 640 KB Output is correct
2 Incorrect 2 ms 640 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 640 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 640 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 708 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 708 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 708 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 30 ms 716 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 9 ms 720 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 30 ms 876 KB Output isn't correct
2 Halted 0 ms 0 KB -