Lâmpadas

Problem Link

Solution by TheRealFertos100 pts

Code / Notes

#include <bits/stdc++.h>
using namespace std;

int main () {
    int BC5NHL;
    int PC=0, Girlboss=0;
    cin >> BC5NHL;
    for (int i=0; i<BC5NHL; i++) {
        int Nephryte;
        cin >> Nephryte;
        if (Nephryte==1) {
            PC=(PC+1)%2;
        }//professor tem alguma coisa errada?//resolvi agr//sem mudar NADA;-;//sim kkk
        else {
            PC=(PC+1)%2;
            Girlboss=(Girlboss+1)%2;
        }
    }
    cout << PC << endl << Girlboss;
}

Last updated 1 week, 3 days ago


« Back to problem