Submission #16871360


Source Code Expand

/**
 * Dont raise your voice, improve your argument.
 * --Desmond Tutu
 */

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

const bool ready = [](){
    ios_base::sync_with_stdio(false); cin.tie(0);
    cout << fixed << setprecision(12);
    return true;
}();

const double PI = acos(-1);
using ll= long long;
#define int ll
#define all(v) (v).begin(), (v).end()
#define fori(n) for(int i=0; i<int(n); i++)

#define cini(i) int i; cin>>i;
#define cins(s) string s; cin>>s;
#define cind(d) double d; cin>>d;
#define cinai(a,n) vi a(n); fori(n) { cin>>a[i]; }
#define cinas(s,n) vs s(n); fori(n) { cin>>s[i]; }
#define cinad(a,n) vd a(n); fori(n) { cin>>a[i]; }

using pii= pair<int, int>;
using pdd= pair<double, double>;
using vd= vector<double>;
using vb= vector<bool>;
using vi= vector<int>;
using vvi= vector<vi>;
using vs= vector<string>;

#define endl "\n"

void solve() {
    cini(n);
    int cnt=0;
    string ans="No";
    for(int i=0; i<n; i++) {
        cini(d1);
        cini(d2);
        if(d1==d2)
            cnt++;
        else
            cnt=0;

        if(cnt>=3)
            ans="Yes";
    }
    cout<<ans<<endl;
}

signed main() {
    solve();
}

// FIRST THINK, THEN CODE
// DO NOT JUMP BETWEEN PROBLEMS

Submission Info

Submission Time
Task B - Go to Jail
User spookywooky
Language C++ (GCC 9.2.1)
Score 200
Code Size 1287 Byte
Status AC
Exec Time 7 ms
Memory 3612 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 3
AC × 18
Set Name Test Cases
Sample sample_01.txt, sample_02.txt, sample_03.txt
All hamd_01.txt, hand_02.txt, hand_03.txt, hand_04.txt, hand_05.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, sample_01.txt, sample_02.txt, sample_03.txt
Case Name Status Exec Time Memory
hamd_01.txt AC 7 ms 3564 KiB
hand_02.txt AC 3 ms 3612 KiB
hand_03.txt AC 2 ms 3544 KiB
hand_04.txt AC 2 ms 3452 KiB
hand_05.txt AC 2 ms 3564 KiB
random_01.txt AC 2 ms 3492 KiB
random_02.txt AC 2 ms 3448 KiB
random_03.txt AC 3 ms 3596 KiB
random_04.txt AC 2 ms 3600 KiB
random_05.txt AC 2 ms 3568 KiB
random_06.txt AC 2 ms 3560 KiB
random_07.txt AC 3 ms 3612 KiB
random_08.txt AC 3 ms 3504 KiB
random_09.txt AC 4 ms 3564 KiB
random_10.txt AC 3 ms 3564 KiB
sample_01.txt AC 2 ms 3568 KiB
sample_02.txt AC 2 ms 3608 KiB
sample_03.txt AC 2 ms 3496 KiB