Submission #824561

# Submission time Handle Problem Language Result Execution time Memory
824561 2023-08-14T07:41:15 Z Amylopectin Sandcastle 2 (JOI22_ho_t5) C++14
9 / 100
5 ms 1064 KB
#include <stdio.h>
#include <iostream>
#include <algorithm>
using namespace std;
const long long mxn = 1e6 + 10;
long long ta[mxn] = {};

int main()
{
    long long i,j,n,m,cn,cm,fn,fm,k,o,q,be,csu = 0;
    scanf("%lld %lld",&n,&m);
    csu = m;
    be = 0;
    for(i=0; i<m; i++)
    {
        scanf("%lld",&ta[i]);
        if(i > 1)
        {
            if((ta[i] - ta[i-1]) * (ta[i-1] - ta[i-2]) < 0)
            {
                cn = i-be;
                csu += cn * (cn-1) / 2;
                be = i-1;
            }
        }
    }
    cn = m-be;
    csu += cn * (cn-1) / 2;
    printf("%lld\n",csu);
}

Compilation message

Main.cpp: In function 'int main()':
Main.cpp:10:17: warning: unused variable 'j' [-Wunused-variable]
   10 |     long long i,j,n,m,cn,cm,fn,fm,k,o,q,be,csu = 0;
      |                 ^
Main.cpp:10:26: warning: unused variable 'cm' [-Wunused-variable]
   10 |     long long i,j,n,m,cn,cm,fn,fm,k,o,q,be,csu = 0;
      |                          ^~
Main.cpp:10:29: warning: unused variable 'fn' [-Wunused-variable]
   10 |     long long i,j,n,m,cn,cm,fn,fm,k,o,q,be,csu = 0;
      |                             ^~
Main.cpp:10:32: warning: unused variable 'fm' [-Wunused-variable]
   10 |     long long i,j,n,m,cn,cm,fn,fm,k,o,q,be,csu = 0;
      |                                ^~
Main.cpp:10:35: warning: unused variable 'k' [-Wunused-variable]
   10 |     long long i,j,n,m,cn,cm,fn,fm,k,o,q,be,csu = 0;
      |                                   ^
Main.cpp:10:37: warning: unused variable 'o' [-Wunused-variable]
   10 |     long long i,j,n,m,cn,cm,fn,fm,k,o,q,be,csu = 0;
      |                                     ^
Main.cpp:10:39: warning: unused variable 'q' [-Wunused-variable]
   10 |     long long i,j,n,m,cn,cm,fn,fm,k,o,q,be,csu = 0;
      |                                       ^
Main.cpp:11:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   11 |     scanf("%lld %lld",&n,&m);
      |     ~~~~~^~~~~~~~~~~~~~~~~~~
Main.cpp:16:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   16 |         scanf("%lld",&ta[i]);
      |         ~~~~~^~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 5 ms 1040 KB Output is correct
3 Correct 5 ms 1064 KB Output is correct
4 Correct 5 ms 980 KB Output is correct
5 Correct 4 ms 980 KB Output is correct
6 Correct 5 ms 980 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -