Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
100310 陈志轩 平台上的小球 C++ 通过 100 0 MS 268 KB 665 2023-08-25 11:03:57

Tests(6/6):


#include<bits/stdc++.h> using namespace std; int a[114514],b[114514],c[114514]; int main(){ int n; cin>>n; for (int i = 1;i <= n;i++){ cin>>a[i]>>b[i]>>c[i]; } a[0] = -1,b[0] = -0x3f3f3f3f,c[0] = 0x3f3f3f3f; for (int i = 1;i <= n;i++){ int x = -2,xx = -2,y = -2,yy = -2; for (int j = 1;j <= n;j++){ if (a[j] < a[i] && b[j] < b[i] && c[j] >= b[i]){ if (a[j] > xx){ x = j; xx = a[j]; } } } cout<<max(x,0)<<' '; for (int j = 1;j <= n;j++){ if (a[j] < a[i] && b[j] <= c[i] && c[j] > c[i]){ if (a[j] > yy){ y = j; yy = a[j]; } } } cout<<max(y,0)<<'\n'; } return 0; }


测评信息: