Skip to content

Saberlilya/Assignments

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 

Repository files navigation

It`s a introduce of Saber.

Saber

Saber is is the heroine of the Japanese animation "fate stay night".

Introduce of Baidu Encyclopedia

int main() 
{
   cin >> n;
   for (int i = 0; i < n; i ++) cin >> a[i];

   int res = 0;
   for (int i = 0; i < n; i ++)//左端点
   {
       int minv = INF, maxv = -INF;
       for (int j = i; j < n; j ++)//右端点
       {
           minv = min(minv ,a[j]);
           maxv = max(maxv ,a[j]);
           if(maxv - minv == j - i) res++;
       }
   }
   cout << res << endl;
       return 0;
}
  • 第一Saber
  • 第二Saber
  1. 第一Saber
  2. 第二Saber
age gender
18 female

Saber

Saber

Saber



About

JLU homework of Computer Professional English

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors