結果
問題 |
No.3221 Count Turns
|
ユーザー |
|
提出日時 | 2025-08-01 21:41:25 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,402 bytes |
コンパイル時間 | 3,862 ms |
コンパイル使用メモリ | 225,668 KB |
実行使用メモリ | 7,720 KB |
最終ジャッジ日時 | 2025-08-01 21:41:34 |
合計ジャッジ時間 | 6,430 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 6 WA * 30 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:53:14: warning: structured bindings only available with ‘-std=c++17’ or ‘-std=gnu++17’ [-Wc++17-extensions] 53 | auto [num, id] = pq.top(); pq.pop(); | ^
ソースコード
#include <bits/stdc++.h> #include <stdlib.h> #include <atcoder/all> using namespace atcoder; using namespace std; #define rep(i, a, n) for(ll i = a; i < n; i++) #define rrep(i, a, n) for(ll i = a; i >= n; i--) #define inr(l, x, r) (l <= x && x < r) #define ll long long #define pii pair<int, int> #define pll pair<ll, ll> #define all(x) (x).begin(), (x).end() //constexpr ll MOD = 1000000007; constexpr ll MOD = 998244353; constexpr int IINF = 1001001001; constexpr ll INF = 1LL<<60; template<class t,class u> void chmax(t&a,u b){if(a<b)a=b;} template<class t,class u> void chmin(t&a,u b){if(b<a)a=b;} using mint = modint998244353; ll gcd(ll a, ll b){ if(a%b == 0){ return b; }else{ return gcd(b, a%b); } } ll lcm(ll a, ll b){ return a*b / gcd(a, b); } ll powMod(ll x, ll n, ll mod) { if (n == 0) return 1 % mod; ll val = powMod(x, n / 2, mod); val *= val; val %= mod; if (n % 2 == 1) val *= x; return val % mod; } int main() { ll n, h, t; cin >> n >> h >> t; vector<ll> a(n); rep(i,0,n) cin >> a[i]; vector<ll> ans(n); priority_queue<pll,vector<pll>,greater<pll>> pq; rep(i,0,n){ pq.push({(h-1)/a[i]+1,i}); } rep(i,0,t){ auto [num, id] = pq.top(); pq.pop(); ans[id]++; pq.push({num+(h-1)/a[id]+1,id}); } for(auto x: ans) cout << x << " "; cout << endl; return 0; }