QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#384824#3761. 2020ucup-team1251AC ✓6ms3772kbC++171.9kb2024-04-10 13:03:462024-04-10 13:03:47

Judging History

你现在查看的是最新测评结果

  • [2024-04-10 13:03:47]
  • 评测
  • 测评结果:AC
  • 用时:6ms
  • 内存:3772kb
  • [2024-04-10 13:03:46]
  • 提交

answer

 /**
*        ┏┓   ┏┓+ +
*       ┏┛┻━━━┛┻┓ + +
*       ┃       ┃  
*       ┃   ━   ┃ ++ + + +
*       ████━████ ┃+
*       ┃       ┃ +
*       ┃   ┻   ┃
*       ┃       ┃ + +
*       ┗━┓   ┏━┛
*         ┃   ┃           
*         ┃   ┃ + + + +
*         ┃   ┃    Code is far away from bug with the animal protecting       
*         ┃   ┃ +     神兽保佑,代码无bug  
*         ┃   ┃
*         ┃   ┃  +         
*         ┃    ┗━━━┓ + +
*         ┃        ┣┓
*         ┃        ┏┛
*         ┗┓┓┏━┳┓┏┛ + + + +
*          ┃┫┫ ┃┫┫
*          ┗┻┛ ┗┻┛+ + + +
*/
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define inf 0x3f3f3f3f
#define pii pair<int,int>

const int N = 1e5 + 20;
int n,m;
string s;
int a[N];
bool chack()
{
}
void inti()
{   
}
void solve()
{
    int cnt  = 0;
    for(int i = 0 ; i  < n; i++){
        if(s[i] == '2' && s[i+1] =='0' && s[i+2] == '2' && s[i +3] == '0'){
            cnt ++;
            i = i + 3;
        }
    }
    cout << cnt << "\n";
}

signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int T = 1;
    // cin >> T;
    while(cin >> n >> s){
        solve();
    }
   return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 6ms
memory: 3772kb

input:

4
2020
6
202020
10
1202012020
10
2222220000
10
0221200202
10
2202021022
10
0200222200
10
2222022122
10
2122222220
10
2200200002
10
2022222222
10
0000020220
10
0220022200
10
2020012000
10
0020020022
10
2220000020
10
0100220202
10
2202021022
10
0220222022
10
0220020000
10
0200000002
10
0202020002
10
2...

output:

1
1
2
0
0
1
0
0
0
0
0
0
0
1
0
0
1
1
0
0
0
1
0
1
1
1
0
1
0
0
0
0
0
1
0
0
1
1
0
0
0
0
1
0
0
0
0
1
0
0
0
0
0
1
0
0
0
0
0
0
0
1
1
0
0
0
0
1
0
1
2
0
1
1
0
0
0
0
1
1
0
1
1
0
0
0
1
0
0
1
0
1
0
1
1
0
0
1
1
0
0
0
1
0
0
0
1
1
0
0
1
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
1
1
0
0
2
1
...

result:

ok 11116 lines