Submission #995589


Source Code Expand

#include <cstdio>
#include <cmath>
#include <cstring>
#include <ctime>
#include <climits>
#include <iostream>
#include <algorithm>
#include <set>
#include <map>
#include <queue>
#include <vector>
#include <sstream>
#include <typeinfo>
#include <fstream>

#define DIV 1000000007

using namespace std;

long long N;
long long A[100005];
long long B[100005];
int main(){
	cin >> N;
	long long ans = 0;
	for(int i = 0; i < N; i++){
		cin >> A[i] >> B[i];
	}

	if(A[0] == 0 && B[0] == 1){
		return 1;
	}else{
		ans += N - 1;
		for(int i = 2; i < N; i++){
			if(A[i] == 1 && B[i] == 1){
				ans++;
			}
		}


		cout << ans << endl;
	}

}

Submission Info

Submission Time
Task A - Distance Pairs
User motomuman
Language C++14 (GCC 5.4.1)
Score 0
Code Size 674 Byte
Status WA
Exec Time 87 ms
Memory 1792 KB

Judge Result

Set Name sample All
Score / Max Score 0 / 0 0 / 1500
Status
RE × 2
AC × 5
WA × 21
RE × 7
Set Name Test Cases
sample sample-01.txt, sample-02.txt
All sample-01.txt, sample-02.txt, 01-01.txt, 01-02.txt, 01-03.txt, 01-04.txt, 01-05.txt, 01-06.txt, 01-07.txt, 01-08.txt, 01-09.txt, 01-10.txt, 01-11.txt, 01-12.txt, 01-13.txt, 01-14.txt, 01-15.txt, 01-16.txt, 01-17.txt, 01-18.txt, 01-19.txt, 01-20.txt, 01-21.txt, 01-22.txt, 01-23.txt, 01-24.txt, 01-25.txt, 01-26.txt, 01-27.txt, 01-28.txt, 01-29.txt, 01-30.txt, 01-31.txt
Case Name Status Exec Time Memory
01-01.txt WA 76 ms 1792 KB
01-02.txt WA 41 ms 1792 KB
01-03.txt RE 2 ms 256 KB
01-04.txt RE 2 ms 256 KB
01-05.txt AC 3 ms 256 KB
01-06.txt WA 21 ms 1152 KB
01-07.txt WA 60 ms 1792 KB
01-08.txt WA 54 ms 1792 KB
01-09.txt WA 51 ms 1792 KB
01-10.txt WA 45 ms 1792 KB
01-11.txt AC 58 ms 1792 KB
01-12.txt AC 53 ms 1792 KB
01-13.txt AC 85 ms 1792 KB
01-14.txt AC 87 ms 1792 KB
01-15.txt RE 69 ms 1792 KB
01-16.txt WA 38 ms 1792 KB
01-17.txt WA 39 ms 1792 KB
01-18.txt RE 39 ms 1792 KB
01-19.txt WA 85 ms 1792 KB
01-20.txt WA 81 ms 1792 KB
01-21.txt WA 82 ms 1792 KB
01-22.txt WA 76 ms 1792 KB
01-23.txt WA 54 ms 1792 KB
01-24.txt WA 52 ms 1792 KB
01-25.txt WA 52 ms 1792 KB
01-26.txt WA 53 ms 1792 KB
01-27.txt WA 52 ms 1792 KB
01-28.txt WA 54 ms 1792 KB
01-29.txt WA 3 ms 256 KB
01-30.txt WA 3 ms 256 KB
01-31.txt RE 2 ms 256 KB
sample-01.txt RE 3 ms 256 KB
sample-02.txt RE 2 ms 256 KB