Submission #58672930
Source Code Expand
Copy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#include<bits/stdc++.h>
using namespace std;
#define LL long long
const int N = 2e5+5;
int n;
char s[N];
int main()
{
// freopen("in.in","r",stdin);
// freopen("out.out","w",stdout);
scanf("%d",&n);
scanf("%s",s+1);
int ans=0;
// cout<<s+1<<'\n';
for(int i=1;i<=n-2;i++)
{
if(s[i]=='#'&&s[i+2]=='#'&&s[i+1]=='.') ans++;
}
printf("%d\n",ans);
return 0;
}
Submission Info
Submission Time
2024-10-12 12:03:26
Task
A - Seats
User
ppllxx
Language
C++ 20 (gcc 12.2)
Score
100
Code Size
390 Byte
Status
AC
Exec Time
2 ms
Memory
4068 KB
Compile Error
Main.cpp: In function ‘int main()’:
Main.cpp:12:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
12 | scanf("%d",&n);
| ~~~~~^~~~~~~~~
Main.cpp:13:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
13 | scanf("%s",s+1);
| ~~~~~^~~~~~~~~~
Judge Result
Set Name
Sample
All
Score / Max Score
0 / 0
100 / 100
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
Case Name
Status
Exec Time
Memory
sample00.txt
AC
1 ms
3816 KB
sample01.txt
AC
1 ms
3652 KB
sample02.txt
AC
1 ms
3680 KB
testcase00.txt
AC
1 ms
3880 KB
testcase01.txt
AC
1 ms
3752 KB
testcase02.txt
AC
1 ms
3816 KB
testcase03.txt
AC
1 ms
3816 KB
testcase04.txt
AC
1 ms
3760 KB
testcase05.txt
AC
1 ms
3624 KB
testcase06.txt
AC
1 ms
3812 KB
testcase07.txt
AC
1 ms
3656 KB
testcase08.txt
AC
1 ms
3840 KB
testcase09.txt
AC
1 ms
3808 KB
testcase10.txt
AC
2 ms
3764 KB
testcase11.txt
AC
1 ms
4064 KB
testcase12.txt
AC
1 ms
3796 KB
testcase13.txt
AC
1 ms
3952 KB
testcase14.txt
AC
1 ms
3864 KB
testcase15.txt
AC
1 ms
4068 KB
testcase16.txt
AC
2 ms
3776 KB
testcase17.txt
AC
2 ms
4068 KB
testcase18.txt
AC
2 ms
3756 KB
testcase19.txt
AC
2 ms
3816 KB