#include <iostream> #include <algorithm> #include <cmath> using namespace std; int main() { //freopen("acm.acm","r",stdin); int n; int m; int i; double tem; double sum_1 = 0; double sum_2 = 0; cin>>n>>m; for(i = 0; i < n-1; ++ i) { cin>>tem; sum_1 += tem; } for(i = 0; i < m-1; ++ i) { cin>>tem; sum_2 += tem; } sum_1 = sqrt(sum_1*sum_1 + sum_2*sum_2); cout<<ceil(sum_1)<<endl; }
关注我的公众号,当然,如果你对Java, Scala, Python等技术经验,以及编程日记,感兴趣的话。
技术网站地址: vmfor.com