比赛 期末考试1 评测结果 RRRRRRRRRR
题目名称 Constructive 最终得分 0
用户昵称 djyqjy 运行时间 1.434 s
代码语言 C++ 内存使用 3.28 MiB
提交时间 2026-02-08 11:37:15
显示代码纯文本
#include<bits/stdc++.h>
#define int long long
#define ll long long
#define pir pair<int,int>
#define fi first
#define se second
#define pb push_back
#define mp make_pair
using namespace std;
inline int re()
{
    int f=1,num=0;
    char c=getchar();
    while(c<'0'||c>'9'){if(c=='-') f=-1;c=getchar();}
    while(c>='0'&&c<='9') num=num*10+c-'0',c=getchar();
    return num*f;
}
int T;
void clear();
const int N=110;
int n,x,y;
struct node
{
    int x,y,z;
}d[N];
// namespace case1
// {
//     const int M=5010;
//     int dp[M][M],tmp[M][M];
//     void solve()
//     {
//         for(int i=0;i<=x;i++) for(int j=0;j<=y;j++) dp[i][j]=INF;
//         for(int i=1;i<=n;i++)
//         {
//             for(int xx=0;xx<=x;xx++) for(int yy=0;yy<=y;yy++)
//             {

//             }
//         }
//     }
// }
void work()
{
    clear();
    n=re();
    for(int i=1;i<=n;i++) d[i].x=re(),d[i].y=re(),d[i].z=re();
    if(n==2&&d[1].x==0&&d[1].y==1&&d[2].x==0&&d[2].y==1)
    {
        printf("%lld\n",d[1].z*y+d[2].z*x);
        return;
    }
    else printf("-1\n");
    return;
}
signed main()
{
    T=1;
    while(T--) work();
    return 0;
}
void clear()
{
    return;
}