QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#510905 | #7841. Boat Commuter | Umok | WA | 10ms | 3684kb | C++23 | 816b | 2024-08-09 14:00:13 | 2024-08-09 14:00:13 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define ll long long
const int N = 2e5 + 9;
const int mod = 1e9 + 7;
#define eps 1e-5
#define inf 2e18
map<int,int> mp,ans;
void solve()
{
ll n,m,k;cin>>n>>m>>k;
for(int i = 1;i <= k;++ i)
{
int x,y;cin>>x>>y;
if(mp.find(y) != mp.end())
{
ans[y] -= 100;
if(mp[y]==x) ans[y] +=100;
else
{
ans[y] += abs(mp[y] - x);
mp[y] = x;
}
}
else mp[y] = x,ans[y] += 100;
}
//cout<<ans<<'\n';
for(int i= 1;i<=m;++i)
cout<< ans[i] << ' ';
}
int main()
{
ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
int _ = 1; // cin>>_;
while (_--) solve();
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3608kb
input:
3 3 5 1 1 1 2 1 2 3 1 2 3
output:
2 100 100
result:
ok single line: '2 100 100 '
Test #2:
score: -100
Wrong Answer
time: 10ms
memory: 3684kb
input:
50 10 100000 16 6 7 1 18 1 39 3 30 3 27 5 27 1 25 8 8 4 30 5 48 10 20 1 25 9 40 1 1 8 15 6 24 5 49 9 46 1 42 8 35 4 47 4 28 6 16 7 46 9 30 9 32 8 8 7 40 5 29 10 48 6 42 2 25 8 16 5 41 6 23 7 40 10 33 9 50 8 13 9 41 3 27 5 38 6 7 3 46 10 26 4 33 5 31 9 27 7 50 10 37 5 9 6 30 2 7 8 27 4 20 9 25 4 47 9...
output:
-805791 -817034 -812397 -819794 -824275 -798353 -803501 -822177 -806866 -817425
result:
wrong answer 1st lines differ - expected: '94844 94854 93814 91551 95910 91226 92395 94770 92170 93178', found: '-805791 -817034 -812397 -81979...803501 -822177 -806866 -817425 '