Compile Error
foo.c:1:10: fatal error: bits/stdc++.h: No such file or directory 1 | #include <bits/stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
Code
#include <bits/stdc++.h>
using namespace std;
void solv()
{
int n;
cin>>n;
string samp;
cin>>samp;
int sum = 0,flag = 0;
for(int i = 0; i < n - 1; i++)
{
if(samp[i] == '1' && samp[i+1] == '1')
{
sum++;
}
else if(samp[i] == '1')
{
flag = 1;
}
else {
continue;
}
}
if(flag == 1 && sum == 0)
{
cout<<1<<endl;
}
else
{
cout<<sum<<endl;
}
}
int main()
{
int t;
cin>>t;
while(t--)
{
solv();
}
}
Information
- Submit By
- Type
- Submission
- Problem
- P1113 Fliping Game
- Language
- C99 (GCC 13.2.0)
- Submit At
- 2024-11-05 21:59:49
- Judged At
- 2024-11-05 21:59:49
- Judged By
- Score
- 0
- Total Time
- 0ms
- Peak Memory
- 0 Bytes