Submission #1304502
Source Code Expand
#include<bits/stdc++.h> using namespace std; int n, m, x, y; int a[100010], b[100010]; int main(){ cin >> n >> m >> x >> y; for(int i = 0; i < n; i++){ cin >> a[i]; } for(int i = 0; i < m; i++){ cin >> b[i]; } int i = 0;//侵食 int j = 0;//侵食 int cnt = 0;//回数 int now = 0;//現在時刻 while(1){ if(cnt / 2 == 0){ for(int k = i; k < n; k++){ if(a[k] < now){ now = a[k] + x; cnt++; i = k; break; } if(d == n-1) break; } else { if(int k = j; k < m; k++){ now = b[k] + y; cnt++; j = k; break; } if(d == n-1) break; } } } } cout << cnt/2 << endl; return 0; }
Submission Info
Submission Time | |
---|---|
Task | C - 飛行機乗り |
User | Toufukun |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 653 Byte |
Status | CE |
Compile Error
./Main.cpp: In function ‘int main()’: ./Main.cpp:27:6: error: ‘d’ was not declared in this scope if(d == n-1) break; ^ ./Main.cpp:28:3: error: expected ‘}’ before ‘else’ } else { ^ ./Main.cpp:29:15: error: expected ‘)’ before ‘;’ token if(int k = j; k < m; k++){ ^ ./Main.cpp:29:17: error: ‘k’ was not declared in this scope if(int k = j; k < m; k++){ ^ ./Main.cpp:35:5: error: ‘d’ was not declared in this scope if(d == n-1) break; ^ ./Main.cpp: At global scope: ./Main.cpp:39:1: error: expected declaration before ‘}’ token } ^