結果
| 問題 | 
                            No.2453 Seat Allocation
                             | 
                    
| コンテスト | |
| ユーザー | 
                             tails
                         | 
                    
| 提出日時 | 2023-09-01 22:16:59 | 
| 言語 | cLay  (20241019-1)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 43 ms / 2,000 ms | 
| コード長 | 276 bytes | 
| コンパイル時間 | 2,435 ms | 
| コンパイル使用メモリ | 190,476 KB | 
| 実行使用メモリ | 8,932 KB | 
| 最終ジャッジ日時 | 2025-06-20 01:44:51 | 
| 合計ジャッジ時間 | 4,208 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge5 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 23 | 
ソースコード
struct C{ll i,j;};
ll a[1d5],b[1d5];
bool operator<(C x,C y){
	ll d=a[x.i]*b[y.j]-a[y.i]*b[x.j];
	return d<0?1:d>0?0:x.i>y.i;
}
{
	ll@n,@m;
	rd(a(n),b(m));
	priority_queue<C>q;
	rep(i,n)q.push({i,0});
	rep(m){
		C c=q.top();
		q.pop();
		wt(c.i+1);
		c.j++;
		q.push(c);
	}
}
            
            
            
        
            
tails