제출 #312463

#제출 시각아이디문제언어결과실행 시간메모리
312463nekiHokej (COCI17_hokej)C++14
0 / 120
844 ms33424 KiB
#include <bits/stdc++.h>
#define loop(i, a, b) for(long long i=a;i<b;i++)
#define pool(i, a, b) for(long long i=a-1;i>=b;i--)
#define fore(i, a) for(auto&& i:a)
#define fi first
#define se second
#define ps(a) push_back(a)
#define pb(a) pop_back(a)
#define sc scanf
#define vc vector
#define pa pair<ll, ll>
#define ll long long
#define lb lower_bound
#define ub upper_bound
#define all(a) a.begin(), a.end()
#define llmax LLONG_MAX/2
#define llmin -LLONG_MAX/2
using namespace std;
#define mn 26000
#define pa pair<ll, ll>
#define ld long double 

vc<vc<ll>> pr, srt;

int main(){
    ll m, n;cin >> m >> n;
    loop(i, 1, n+1){
        ll k, j;cin >> k >> j;
        vc<ll> temp={k, j, i};
        srt.ps(temp);
    }
    sort(all(srt));
    ll cur=n-7;
    vc<vc<ll>> kdo;
    pool(i, n, n-6) kdo.ps(srt[i]);
    ll ans=0;
    loop(i, 1, m+1){
        loop(j, 0, 6)if(kdo[j][1]==i-1){
            vc<ll> temp={i-1, kdo[j][2], srt[cur][2]};
            pr.ps(temp);
            kdo[j]=srt[cur];
            kdo[j][1]+=i;
            cur--;
        }
        loop(j, 0, 6) ans+=kdo[j][0];
    }
    cout << ans<<endl;
    pool(i, n, n-6) cout << srt[i][2]<<" ";cout <<endl;
    cout << pr.size()<<endl;
    fore(v, pr) cout << v[0]<<" "<< v[1]<<" "<< v[2]<<endl;
}

컴파일 시 표준 에러 (stderr) 메시지

hokej.cpp: In function 'int main()':
hokej.cpp:3:23: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
    3 | #define pool(i, a, b) for(long long i=a-1;i>=b;i--)
      |                       ^~~
hokej.cpp:48:5: note: in expansion of macro 'pool'
   48 |     pool(i, n, n-6) cout << srt[i][2]<<" ";cout <<endl;
      |     ^~~~
hokej.cpp:48:44: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   48 |     pool(i, n, n-6) cout << srt[i][2]<<" ";cout <<endl;
      |                                            ^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...