QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#392906 | #8136. Rebellious Edge | OOBMABTRAMS# | WA | 1ms | 3724kb | C++20 | 582b | 2024-04-17 22:11:20 | 2024-04-17 22:11:21 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=500013;
int a[N];
const int mod=1e9+7;
vector<int>mp[N];
int ans[N];
void solve(){
int n,m;
cin>>n>>m;
for(int i=1;i<=n;i++)ans[i]=2e9;
for(int i=1;i<=m;i++){
int x,y,zz;
cin>>x>>y>>zz;
if(x>y)swap(x,y);
ans[y]=min(ans[y],zz);
}
ll as=0;
for(int i=2;i<=n;i++)as+=ans[i];
cout<<as<<'\n';
}
signed main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
int T=1;
cin>>T;
while(T--)solve();
}
详细
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3724kb
input:
3 5 6 1 2 4 1 3 2 2 3 0 3 4 1 4 5 1 5 2 1 4 4 1 2 4 1 3 6 1 4 8 4 2 1000000 3 3 1 2 100 2 1 10 2 3 1000
output:
6 18 1010
result:
wrong answer 1st numbers differ - expected: '5', found: '6'