# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
890453 |
2023-12-21T09:28:54 Z |
ezzzay |
Money (IZhO17_money) |
C++14 |
|
0 ms |
348 KB |
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define ff first
#define pb push_back
#define inf LLONG_MAX
#define ss second
const int N=3e5+5;
int arr[N];
signed main(){
int n;
cin>>n;
for(int i=1;i<=n;i++){
cin>>arr[i];
}
int x=0;
for(int i=1;i<=n;i++){
x++;
while(arr[i+1]-arr[i]==1 ){
i++;
}
}
if(x%2){
cout<<x/2;
}
else{
cout<<x/2+1;
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |