QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#327481#7843. Delivery ForcesComplexity_CutterRE 0ms0kbC++141017b2024-02-15 01:43:332024-02-15 01:43:33

Judging History

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

  • [2024-02-15 01:43:33]
  • 评测
  • 测评结果:RE
  • 用时:0ms
  • 内存:0kb
  • [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;
}




詳細信息

Test #1:

score: 0
Runtime Error

input:

3
1 2 3

output:


result: