#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;
}
Compilation message
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;
| ^~~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Failed |
1 ms |
384 KB |
some player fainted |
2 |
Failed |
8 ms |
768 KB |
some player fainted |
3 |
Failed |
40 ms |
1968 KB |
some player fainted |
4 |
Failed |
1 ms |
384 KB |
some player fainted |
5 |
Failed |
16 ms |
1084 KB |
some player fainted |
6 |
Failed |
6 ms |
640 KB |
some player fainted |
7 |
Failed |
10 ms |
1024 KB |
some player fainted |
8 |
Failed |
138 ms |
7076 KB |
some player fainted |
9 |
Failed |
835 ms |
33288 KB |
some player fainted |
10 |
Failed |
844 ms |
33424 KB |
some player fainted |