제출 #465256

#제출 시각아이디문제언어결과실행 시간메모리
465256CyberCowExam (eJOI20_exam)C++17
12 / 100
29 ms3072 KiB
#include <iostream> #include <algorithm> #include <vector> #include <queue> #include <set> #include <string> #include <cmath> #include <map> #include <unordered_map> #include <fstream> #include <iomanip> #include <iterator> #include <stack> using namespace std; using ll = long long; const int maxn = 100005; int a[maxn]; int b[maxn]; bool stug[maxn]; int main() { ios_base::sync_with_stdio(false); cin.tie(0); int n, i, j; cin >> n; for ( i = 0; i < n; i++) { cin >> a[i]; } for (i = 0; i < n; i++) { cin >> b[i]; } if(1) { for ( i = 0; i < n; i++) { if (a[i] == b[0]) { j = i - 1; while (j >= 0 && a[j] != b[0] && a[j] <= b[0]) { a[j] = b[0]; j--; } j = i + 1; while (j < n && a[j] != b[0] && a[j] <= b[0]) { a[j] = b[0]; j++; } } } int ans = 0; for ( i = 0; i < n; i++) { if (a[i] == b[0]) ans++; } cout << ans; } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...