QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#327481 | #7843. Delivery Forces | Complexity_Cutter | RE | 0ms | 0kb | C++14 | 1017b | 2024-02-15 01:43:33 | 2024-02-15 01:43:33 |
answer
#include<bits/stdc++.h>
using namespace std;
#define debug cout<<"Debug\n";
#define en '\n'
#define all(x) x.begin() , x.end()
#define ll long long
#define pi acos(-1.0)
#define mod 1000000007
#define _fastio_ ios_base:: sync_with_stdio(false); cin.tie(0); cout.tie(0);
int main(){
_fastio_
ll t;
ll n,m,k;
cin>>n>>m>>k;
vector<ll>v[m+10];
for(ll i=1;i<=k;i++){
ll p,c;
cin>>p>>c;
v[c].emplace_back(p);
}
ll ans=0;
for(ll i=1;i<=m;i++){
ll ans=0;
if(v[i].size()>=1){
//sort(all(v[i]));
for(ll j=0;j<v[i].size();j+=2){
if(j+1<v[i].size()){
if(v[i][j]==v[i][j+1]) ans+=100;
else ans+=abs(v[i][j+1]-v[i][j]);
}
else{
ans+=100;
}
}
}
cout<<ans<<' ';
}
cout<<en;
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Runtime Error
input:
3 1 2 3