QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#392904#8136. Rebellious EdgeOOBMABTRAMS#WA 1ms3732kbC++20582b2024-04-17 22:10:442024-04-17 22:10:45

Judging History

你现在查看的是最新测评结果

  • [2024-04-17 22:10:45]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3732kb
  • [2024-04-17 22:10:44]
  • 提交

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<=n;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();
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 1ms
memory: 3732kb

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
2000000014
1010

result:

wrong answer 1st numbers differ - expected: '5', found: '6'