Submission #4130695


Source Code Expand

Copy
#include <bits/stdc++.h>
using namespace std;
using int64 = int64_t;
#define int int64

signed main() {
  int n; cin >> n;
  vector<int> a(n);
  for(int i=0;i<n;++i) cin >> a[i];
  
  int ans = 0, ub = 0;
  for(int lb=0;lb<n;++lb){
	ub = max(ub, lb+1);
	while (ub < n && a[ub-1] < a[ub]){
	  ++ub;
	}
    ans += ub - lb;
  }
  cout << ans << endl;
  
  return 0;
}

Submission Info

Submission Time
Task C - 単調増加
User task4233
Language C++14 (GCC 5.4.1)
Score 100
Code Size 387 Byte
Status AC
Exec Time 30 ms
Memory 1024 KB

Judge Result

Set Name Sample Subtask0 All
Score / Max Score 0 / 0 40 / 40 60 / 60
Status
AC × 4
AC × 19
AC × 35
Set Name Test Cases
Sample sample0.txt, sample1.txt, sample2.txt, sample3.txt
Subtask0 sample0.txt, sample1.txt, sample2.txt, sample3.txt, subtask0_0.txt, subtask0_1.txt, subtask0_10.txt, subtask0_11.txt, subtask0_12.txt, subtask0_13.txt, subtask0_14.txt, subtask0_2.txt, subtask0_3.txt, subtask0_4.txt, subtask0_5.txt, subtask0_6.txt, subtask0_7.txt, subtask0_8.txt, subtask0_9.txt
All sample0.txt, sample1.txt, sample2.txt, sample3.txt, subtask0_0.txt, subtask0_1.txt, subtask0_10.txt, subtask0_11.txt, subtask0_12.txt, subtask0_13.txt, subtask0_14.txt, subtask0_2.txt, subtask0_3.txt, subtask0_4.txt, subtask0_5.txt, subtask0_6.txt, subtask0_7.txt, subtask0_8.txt, subtask0_9.txt, subtask1_0.txt, subtask1_1.txt, subtask1_10.txt, subtask1_11.txt, subtask1_12.txt, subtask1_13.txt, subtask1_14.txt, subtask1_15.txt, subtask1_2.txt, subtask1_3.txt, subtask1_4.txt, subtask1_5.txt, subtask1_6.txt, subtask1_7.txt, subtask1_8.txt, subtask1_9.txt
Case Name Status Exec Time Memory
sample0.txt AC 1 ms 256 KB
sample1.txt AC 1 ms 256 KB
sample2.txt AC 1 ms 256 KB
sample3.txt AC 1 ms 256 KB
subtask0_0.txt AC 2 ms 256 KB
subtask0_1.txt AC 2 ms 256 KB
subtask0_10.txt AC 2 ms 256 KB
subtask0_11.txt AC 2 ms 256 KB
subtask0_12.txt AC 2 ms 256 KB
subtask0_13.txt AC 2 ms 256 KB
subtask0_14.txt AC 2 ms 256 KB
subtask0_2.txt AC 2 ms 256 KB
subtask0_3.txt AC 2 ms 256 KB
subtask0_4.txt AC 2 ms 256 KB
subtask0_5.txt AC 1 ms 256 KB
subtask0_6.txt AC 1 ms 256 KB
subtask0_7.txt AC 2 ms 256 KB
subtask0_8.txt AC 1 ms 256 KB
subtask0_9.txt AC 2 ms 256 KB
subtask1_0.txt AC 26 ms 896 KB
subtask1_1.txt AC 11 ms 512 KB
subtask1_10.txt AC 29 ms 1024 KB
subtask1_11.txt AC 29 ms 1024 KB
subtask1_12.txt AC 29 ms 1024 KB
subtask1_13.txt AC 30 ms 1024 KB
subtask1_14.txt AC 29 ms 1024 KB
subtask1_15.txt AC 30 ms 1024 KB
subtask1_2.txt AC 9 ms 512 KB
subtask1_3.txt AC 20 ms 768 KB
subtask1_4.txt AC 22 ms 896 KB
subtask1_5.txt AC 21 ms 768 KB
subtask1_6.txt AC 13 ms 512 KB
subtask1_7.txt AC 27 ms 896 KB
subtask1_8.txt AC 8 ms 384 KB
subtask1_9.txt AC 5 ms 384 KB