QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#696738 | #8760. 不等式 | coloury | WA | 0ms | 3836kb | C++23 | 570b | 2024-11-01 00:58:35 | 2024-11-01 00:58:35 |
Judging History
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'