QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#734595 | #7524. A Challenge For a Tourist | Ln | WA | 1ms | 3624kb | C++14 | 755b | 2024-11-11 13:04:25 | 2024-11-11 13:04:26 |
Judging History
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;
}
Details
Tip: Click on the bar to expand more detailed information
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'