QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#734595#7524. A Challenge For a TouristLnWA 1ms3624kbC++14755b2024-11-11 13:04:252024-11-11 13:04:26

Judging History

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

  • [2024-11-11 13:04:26]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3624kb
  • [2024-11-11 13:04:25]
  • 提交

answer

// Online C++ compiler to run C++ program online
#include <bits/stdc++.h>

using namespace std;

int main(){
    
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    
    int n, m;cin >> n >> m;
    
    vector<vector<long>> cityMap (n + 1, vector<long> (m + 1, 0));
    
    for(int i = 0; i < m; i++){
        
        int a, b;
        long r; cin >> a >> b >> r;
        
        cityMap[a][b] = max(cityMap[a][b],r);
    }
    
    int q; cin >> q;
    
    while(q--){
        
        int f, t;
        long r; cin >> f >> t >> r;
        
        if(r == 1)cout << "-1\n";
        else cout << r - 1 << '\n';
        
    }
    
    
    
    
    
    
    
    
    
    
    
    return 0;
}

详细

Test #1:

score: 100
Accepted
time: 1ms
memory: 3624kb

input:

6 6
5 6 3
6 2 2
1 2 1
2 3 2
2 4 3
4 5 4
3
1 3 1
1 3 3
1 3 5

output:

-1
2
4

result:

ok 3 number(s): "-1 2 4"

Test #2:

score: -100
Wrong Answer
time: 0ms
memory: 3492kb

input:

2 1
1 2 1
1
1 2 1

output:

-1

result:

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