답안 #524920

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
524920 2022-02-10T10:17:40 Z Polsk1mlot Money (IZhO17_money) C++17
0 / 100
1 ms 312 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;
}
main()
{
//  freopen(".in" , "r" , stdin) ;
//  freopen(".out" , "w" , stdout) ;
	turbo ;
	int n;
	cin >> n;
	vector<int> a(n);
	for(int i = 0; i < n; i++) cin >> a[i];
	int ser = 1;
	int ans = 1e6;
	for(int i = 0; i < n - 1; i++){
		if(a[i] <= a[i + 1]){
			ser++;
		}else{
			ans = min(ans, ser);
			ser = 1;
		}
	}
	cout << n / ans;
}

Compilation message

money.cpp:14:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   14 | main()
      | ^~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Incorrect 1 ms 312 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Incorrect 1 ms 312 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Incorrect 1 ms 312 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Incorrect 1 ms 312 KB Output isn't correct
3 Halted 0 ms 0 KB -