답안 #833491

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
833491 2023-08-22T06:10:57 Z vjudge1 Exam (eJOI20_exam) C++17
12 / 100
17 ms 2004 KB
#include <bits/stdc++.h>
#define int long long
#define vi vector<int>
#define endl "\n"
#define invec(name, n) for(int abc = 0; abc < n; abc++) cin >> name[abc];
#define outvec(name, n) for(int abc = 0; abc < n; abc++) cout << name[abc] << " ";
#define format_decimal(x) fixed << setprecision(x)

using namespace std;

void solve()
{
	int n; cin >> n;
	vi h(n), t(n); invec(h, n); invec(t, n);
	bool found = false;
	int ctr = 0;
	int ans = 0;
	for(int i = 0; i < n; i++)
	{
		if(h[i] == t[i]) found = true;
		if(h[i] <= t[i]) ctr++;
		else
		{
			if(found) ans += ctr;
			found = false;
			ctr = 0;
		}
	}
	
	if(found) ans += ctr;
	found = false;
	ctr = 0;
	
	cout << ans;
	
	cout << endl;
}

signed main()
{    
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int t = 1;
    //cin >> t;
    for(int i = 1; i <= t; i++) solve();
    
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 3 ms 596 KB Output is correct
3 Correct 14 ms 1748 KB Output is correct
4 Correct 8 ms 1876 KB Output is correct
5 Correct 17 ms 1876 KB Output is correct
6 Correct 9 ms 1876 KB Output is correct
7 Correct 10 ms 2004 KB Output is correct
8 Correct 17 ms 1876 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 340 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -