Rezultati

Up. imeNalogaJezikRezultatČas oddaje
Deathmask Niz C++ 100/100OK 19. apr '18 @ 16:24

Test Točke Porabljen spomin Porabljen čas Status
#1 10/10 3,109 MiB 0,004 s OK
#2 10/10 3,023 MiB 0,000 s OK
#3 10/10 3,293 MiB 0,022 s OK
#4 10/10 3,289 MiB 0,016 s OK
#5 10/10 3,156 MiB 0,016 s OK
#6 10/10 3,156 MiB 0,003 s OK
#7 10/10 3,297 MiB 0,022 s OK
#8 10/10 3,148 MiB 0,009 s OK
#9 10/10 3,152 MiB 0,016 s OK
#10 10/10 3,156 MiB 0,016 s OK

Ocenjevani program (main.cpp):
#include <iostream>

using namespace std;

int main()
{
    int n;
    cin>>n;
    string s;
    cin>>s;

    int ch=0;
    for (int i=0;i<n;i++)
    {
                if (i==n-2)
                break;
                //cout<<s[i]<<" "<<s[i+1]<<" "<<s[i+2]<<" "<<endl;
        if (s[i]=='0' and s[i+1]=='1' and s[i+2]=='0')
                {
                ch++;
                //cout<<"in"<<endl;
                i=i+2;
                }
    }
    cout<<ch;

}