| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1157557 | ezzzay | Sandcastle 2 (JOI22_ho_t5) | C++20 | 10 ms | 1604 KiB |
#include<bits/stdc++.h>
using namespace std;
signed main(){
int n,m;
cin>>n>>m;
vector< vector<int> > a (n+5, vector<int> (m+5));
for(int i=1;i<=n;i++){
for(int j=1;j<=m;j++)cin>>a[i][j];
}
int p=0;
int ans=0;
for(int i=1;i<=m+1;i++){
if(a[1][i]>a[1][i-1]){
p++;
}
else{
ans+= (p)*(p-1)/2;
p=1;
}
}
for(int i=1;i<=m+1;i++){
if(a[1][i]<a[1][i-1]){
p++;
}
else{
ans+= (p)*(p-1)/2;
p=1;
}
}
cout<<ans+m;
}| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
