QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#696738#8760. 不等式colouryWA 0ms3836kbC++23570b2024-11-01 00:58:352024-11-01 00:58:35

Judging History

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

  • [2024-11-01 00:58:35]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3836kb
  • [2024-11-01 00:58:35]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
const char nl = '\n';
  typedef long long ll;
  typedef long double ld;
typedef long long int lli;  
 const int MOD = 1'000'000'007;


void solve(){
int n,m;
cin >> n >> m;
vector<ll> nums(n + 1,1);
for(int i = 0;i < m;i++){
    ll a,b,c;
    cin >> a >> b >> c;

    if(nums[a] < nums[b] + nums[c]) nums[a] = nums[b] + nums[c];

}
cout << reduce(nums.begin(),nums.end(),0);
}


int main(){
ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
int t = 1;

while(t--){
    solve();
}
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3836kb

input:

3 1
1 2 2

output:

5

result:

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