比赛 20161114 评测结果 AAAAAAAAAA
题目名称 输出全靠花 最终得分 100
用户昵称 KZNS 运行时间 0.068 s
代码语言 C++ 内存使用 6.27 MiB
提交时间 2016-11-14 11:35:08
显示代码纯文本
//KZNS
#include <cstdio>
#include <algorithm>
using namespace std;
int ls[1003][4];
bool mp[50][50][50][50];
int N;
int main() {
    freopen("xumingshi.in", "r", stdin);
    freopen("xumingshi.out", "w", stdout);
    scanf("%d", &N);
    for (int i = 0; i < N; i++) {
        scanf("%d %d %d %d", &ls[i][0], &ls[i][1], &ls[i][2], &ls[i][3]);
        mp[ls[i][0] += 20][ls[i][1] += 20][ls[i][2] += 20][ls[i][3] += 20] = true;
    }
    int ans = 0;
    int mx;
    int a, b, c, d;
    int q, w, e, r;
    for (int i = 0; i < N; i++) {
        for (int j = 0; j < N; j++) {
            if (i == j)
                continue;
            mx = 2;
            a = ls[j][0] - ls[i][0];
            b = ls[j][1] - ls[i][1];
            c = ls[j][2] - ls[i][2];
            d = ls[j][3] - ls[i][3];
            q = ls[j][0] + a;
            w = ls[j][1] + b;
            e = ls[j][2] + c;
            r = ls[j][3] + d;
            while (q >= 0 && w >= 0 && e >= 0 && r >= 0 && 
                    q <= 40 && w <= 40 && e <= 40 && r <= 40) {
                if (mp[q][w][e][r])
                    mx++;
                q += a;
                w += b;
                e += c;
                r += d;
            }
            ans = max(ans, mx);
        }
    }
    printf("%d\n", ans);
    return 0;
}
//UBWH