[Offer收割]编程练习赛51 register

Ended

Participants:280

Verdict:Wrong Answer
Score:70 / 100
Submitted:2018-03-18 13:56:32

Lang:G++

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int n, m, x, y;
inline int calculate(int a, int b) {
    int tmp1, tmp2;
    if (a > 0) tmp1 = (n-x)/a;
    else tmp1 = x/-a;
    if (b > 0) tmp2 = (m-y)/b;
    else tmp2 = y/-b;
    return min(tmp1, tmp2);
}
inline int zhengchu(int a, int b) {
    if (b < 0) b = -b;
    return a/b;
}
int main(int argc, const char *argv[]) {
    int a, b, c, d;
    cin >> n >> m >> x >>y;
    cin >> a >> b >> c >> d;
    int res = 1;
    if (a*b*c*d == 0) {
        // 4 zeros
        if (a==0 && b==0 && c==0 && d==0) {}
        // 3 zeros
        else if (a==0 && b==0 && c==0) res += abs((m-x)/d);
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX