답안 #345045

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
345045 2021-01-07T00:11:45 Z nishuz Lightning Rod (NOI18_lightningrod) C++14
10 / 100
2000 ms 170340 KB
#include <bits/stdc++.h>

using namespace std;

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int n, ans = 0;
    cin >> n;
    vector <pair <int, int>> a(n);
    for (int i = 0; i < n; ++i) cin >> a[i].first >> a[i].second;
    for (int i = 0; i < n; ++i)
    {
        if (a[i].second) ++ans;
        else if ((!i || !a[i-1].second) && (i == n-1 || !a[i+1].second)) ++ans;
    }
    cout << ans << '\n';
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1898 ms 76140 KB Output is correct
2 Execution timed out 2005 ms 76012 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Correct 0 ms 364 KB Output is correct
4 Incorrect 1 ms 364 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Correct 0 ms 364 KB Output is correct
4 Incorrect 1 ms 364 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Correct 0 ms 364 KB Output is correct
4 Incorrect 1 ms 364 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Correct 0 ms 364 KB Output is correct
4 Incorrect 1 ms 364 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1914 ms 78316 KB Output is correct
2 Correct 1882 ms 78188 KB Output is correct
3 Correct 1950 ms 170340 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1898 ms 76140 KB Output is correct
2 Execution timed out 2005 ms 76012 KB Time limit exceeded
3 Halted 0 ms 0 KB -