Submission #69304634
Source Code Expand
//#include "atcoder/modint" #pragma GCC optimize("Ofast") #include "atcoder/all" #include <bits/stdc++.h> #include <string> using namespace std; using namespace atcoder; #define int long long template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; } template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; } //const int MOD =1e9+7; //constexpr int MOD =10; constexpr int MOD =998244353; const long long M1=167772161,M2=469762049,M3=1224736769; //const int MOD =31607; using mint = static_modint<MOD>; //using mint = double; //using mint = modint; ostream& operator << (ostream& ost, const mint& m){ost << m.val();return ost;} istream& operator >> (istream& ost, mint& m){int a;ost >> a;m=a;return ost;} double time_limit = 100.0,start_temp=0.01,end_temp=0.0; int n=500, m=50, l=998000000000000ll, u=1002000000000000ll,a[500],b[50]; int s=2000000000ll,a_s[500],sc=MOD*MOD; std::mt19937 rng(std::random_device{}()); signed main(){ //ios_base::sync_with_stdio(false); //cin.tie(NULL); int n; cin>>n; int l[n]; for(int i=0;i<n;i++)cin>>l[i]; int a=0,b=n; while(l[a]==0&&a<n)a++; while(l[b-1]==0&&b>0)b--; if(a>=b){ cout<<0<<endl; return 0; } cout<<b-a-1<<endl; }
Submission Info
Submission Time | |
---|---|
Task | B - Locked Rooms |
User | yatuba |
Language | C++ 20 (gcc 12.2) |
Score | 200 |
Code Size | 1413 Byte |
Status | AC |
Exec Time | 1 ms |
Memory | 3700 KiB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 200 / 200 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample00.txt, sample01.txt, sample02.txt |
All | sample00.txt, sample01.txt, sample02.txt, testcase00.txt, testcase01.txt, testcase02.txt, testcase03.txt, testcase04.txt, testcase05.txt, testcase06.txt, testcase07.txt, testcase08.txt, testcase09.txt, testcase10.txt, testcase11.txt, testcase12.txt, testcase13.txt, testcase14.txt, testcase15.txt, testcase16.txt, testcase17.txt, testcase18.txt, testcase19.txt, testcase20.txt, testcase21.txt, testcase22.txt, testcase23.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
sample00.txt | AC | 1 ms | 3616 KiB |
sample01.txt | AC | 1 ms | 3548 KiB |
sample02.txt | AC | 1 ms | 3564 KiB |
testcase00.txt | AC | 1 ms | 3580 KiB |
testcase01.txt | AC | 1 ms | 3512 KiB |
testcase02.txt | AC | 1 ms | 3584 KiB |
testcase03.txt | AC | 1 ms | 3612 KiB |
testcase04.txt | AC | 1 ms | 3572 KiB |
testcase05.txt | AC | 1 ms | 3564 KiB |
testcase06.txt | AC | 1 ms | 3508 KiB |
testcase07.txt | AC | 1 ms | 3452 KiB |
testcase08.txt | AC | 1 ms | 3540 KiB |
testcase09.txt | AC | 1 ms | 3700 KiB |
testcase10.txt | AC | 1 ms | 3516 KiB |
testcase11.txt | AC | 1 ms | 3480 KiB |
testcase12.txt | AC | 1 ms | 3700 KiB |
testcase13.txt | AC | 1 ms | 3568 KiB |
testcase14.txt | AC | 1 ms | 3516 KiB |
testcase15.txt | AC | 1 ms | 3480 KiB |
testcase16.txt | AC | 1 ms | 3564 KiB |
testcase17.txt | AC | 1 ms | 3612 KiB |
testcase18.txt | AC | 1 ms | 3512 KiB |
testcase19.txt | AC | 1 ms | 3540 KiB |
testcase20.txt | AC | 1 ms | 3480 KiB |
testcase21.txt | AC | 1 ms | 3516 KiB |
testcase22.txt | AC | 1 ms | 3520 KiB |
testcase23.txt | AC | 1 ms | 3608 KiB |