Submission #48918643
Source Code Expand
// LUOGU_RID: 141351174
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef double db;
typedef long double ldb;
#define rep(i,l,r) for(int i(l);i<=(r);++i)
#define per(i,r,l) for(int i(r);i>=(l);--i)
#define eb emplace_back
#define File(filename) freopen(filename ".in","r",stdin),freopen(filename ".out","w",stdout)
#ifdef EXODUS
#define Debug(...) fprintf(stderr,__VA_ARGS__)
#else
#define Debug(...) 0
#endif
//=========================================================================================================
// Something about IO
template<typename T>
void read(T &x){
x=0;T flg=1;
char ch=getchar();
while(!isdigit(ch)){if(ch=='-')flg=-1;ch=getchar();}
while(isdigit(ch))x=(x<<3)+(x<<1)+(ch^48),ch=getchar();
x*=flg;
}
template<typename T,typename... Args>
void read(T &x,Args &...args){read(x),read(args...);}
//=========================================================================================================
// Define the global variables here.
bool membg=0;
constexpr int N=1e3+7;
int n,p[N];
bool memed=0;
//=========================================================================================================
// Code here.
void solve(){
read(n);
for(int i=1;i<=n;i++)
read(p[i]);
int ans=0,mnv=1e9;
for(int i=n;i>=1;i--)
if(p[i]<mnv)ans++,mnv=p[i];
printf("%d\n",ans);
return;
}
//=========================================================================================================
int main(){
Debug("%.3lfMB\n",fabs(&memed-&membg)/1024.0/1024.0);
int timbg=clock();
int T=1;read(T);
while(T--)solve();
int timed=clock();
Debug("%.3lfs\n",1.0*(timed-timbg)/CLOCKS_PER_SEC);
fflush(stdout);
return 0;
}
Submission Info
| Submission Time |
|
| Task |
A - Ekiden Race |
| User |
EXODUS |
| Language |
C++ 20 (gcc 12.2) |
| Score |
300 |
| Code Size |
1799 Byte |
| Status |
AC |
| Exec Time |
1 ms |
| Memory |
3904 KiB |
Compile Error
Main.cpp: In function ‘int main()’:
Main.cpp:18:28: warning: statement has no effect [-Wunused-value]
18 | #define Debug(...) 0
| ^
Main.cpp:63:9: note: in expansion of macro ‘Debug’
63 | Debug("%.3lfMB\n",fabs(&memed-&membg)/1024.0/1024.0);
| ^~~~~
Main.cpp:18:28: warning: statement has no effect [-Wunused-value]
18 | #define Debug(...) 0
| ^
Main.cpp:68:9: note: in expansion of macro ‘Debug’
68 | Debug("%.3lfs\n",1.0*(timed-timbg)/CLOCKS_PER_SEC);
| ^~~~~
Main.cpp:64:13: warning: unused variable ‘timbg’ [-Wunused-variable]
64 | int timbg=clock();
| ^~~~~
Main.cpp:67:13: warning: unused variable ‘timed’ [-Wunused-variable]
67 | int timed=clock();
| ^~~~~
Judge Result
| Set Name |
Sample |
All |
| Score / Max Score |
0 / 0 |
300 / 300 |
| Status |
|
|
| Set Name |
Test Cases |
| Sample |
sample-01.txt |
| All |
000.txt, 001.txt, 002.txt, 003.txt, 004.txt, 005.txt, 006.txt, 007.txt, 008.txt, 009.txt, 010.txt, 011.txt, 012.txt, sample-01.txt |
| Case Name |
Status |
Exec Time |
Memory |
| 000.txt |
AC |
1 ms |
3848 KiB |
| 001.txt |
AC |
1 ms |
3768 KiB |
| 002.txt |
AC |
1 ms |
3652 KiB |
| 003.txt |
AC |
1 ms |
3716 KiB |
| 004.txt |
AC |
1 ms |
3832 KiB |
| 005.txt |
AC |
1 ms |
3832 KiB |
| 006.txt |
AC |
1 ms |
3652 KiB |
| 007.txt |
AC |
1 ms |
3652 KiB |
| 008.txt |
AC |
1 ms |
3652 KiB |
| 009.txt |
AC |
1 ms |
3904 KiB |
| 010.txt |
AC |
1 ms |
3776 KiB |
| 011.txt |
AC |
1 ms |
3756 KiB |
| 012.txt |
AC |
1 ms |
3700 KiB |
| sample-01.txt |
AC |
1 ms |
3892 KiB |