結果
問題 |
No.3221 Count Turns
|
ユーザー |
![]() |
提出日時 | 2025-08-01 22:25:12 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 780 bytes |
コンパイル時間 | 3,040 ms |
コンパイル使用メモリ | 283,968 KB |
実行使用メモリ | 9,344 KB |
最終ジャッジ日時 | 2025-08-01 22:25:20 |
合計ジャッジ時間 | 5,826 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 6 WA * 30 |
コンパイルメッセージ
main.cpp:17:1: warning: ISO C++ forbids declaration of ‘main’ with no type [-Wreturn-type] 17 | main() { | ^~~~
ソースコード
#include <bits/stdc++.h> using namespace std; #include <atcoder/segtree> #define int long long int N; vector<int> B; int op(int a, int b) { if (B[a] <= B[b]) return a; return b; } int e() { return N; } main() { int H, T; cin >> N >> H >> T; vector<int> A(N); for (int i = 0; i < N; i++) cin >> A[i]; vector<int> R(N+1); for (int i = 0; i < N; i++) { R[i] = (H + A[i] - 1) / A[i]; } R[N] = 1e18; B = R; vector<int> P(N); iota(P.begin(), P.end(), 0); atcoder::segtree<int, op, e> seg(P); int all = 0; vector<int> C(N, 0); for (int i = 0; i < T; i++) { int id = seg.all_prod(); C[id]++; int cnt = max(0LL, B[id] - all); all += cnt; B[id] = R[id] + all; seg.set(id, id); } for (int i = 0; i < N; i++) cout << C[i] << " "; cout << endl; }