Submission #524926

# Submission time Handle Problem Language Result Execution time Memory
524926 2022-02-10T10:27:38 Z Polsk1mlot Money (IZhO17_money) C++17
0 / 100
0 ms 204 KB
#include<bits/stdc++.h>
using namespace std;
#pragma GCC optimize ("unroll-loops,Ofast,O3")
#pragma GCC target("avx,avx2,fma")
#define pi 3.14159265358979323846
//#define int long long
#define turbo ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
int input()
{
	int x;
	cin >> x;
	return x;
}
int main()
{
//  freopen(".in" , "r" , stdin) ;
//  freopen(".out" , "w" , stdout) ;
	turbo ;
	double n;
	cin >> n;
	vector<int> a(n);
	for(int i = 0; i < n; i++) cin >> a[i];
	double ser = 1;
	double ans = 1e6;
	for(int i = 0; i < n - 1; i++){
		if(a[i] <= a[i + 1]){
			ser++;
		}else{
			ans = min(ans, ser);
			ser = 1;
		}
	}
	ans = min(ans, ser);
	cout << endl;
	cout << ceil(n / ans);
	return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Incorrect 0 ms 204 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Incorrect 0 ms 204 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Incorrect 0 ms 204 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Incorrect 0 ms 204 KB Output isn't correct
3 Halted 0 ms 0 KB -