結果
問題 |
No.250 atetubouのzetubou
|
ユーザー |
![]() |
提出日時 | 2020-03-22 12:49:07 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 109 ms / 5,000 ms |
コード長 | 792 bytes |
コンパイル時間 | 2,672 ms |
コンパイル使用メモリ | 196,920 KB |
最終ジャッジ日時 | 2025-01-09 09:37:21 |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 20 |
ソースコード
#include<bits/stdc++.h> using lint=long long; lint inf=std::numeric_limits<lint>::max(); lint add(lint x,lint y){return inf-x<=y?inf:x+y;} void add_eq(lint&x,lint y){x=add(x,y);} int main(){ std::cin.tie(nullptr);std::ios_base::sync_with_stdio(false); std::cout.setf(std::ios_base::fixed);std::cout.precision(15); lint max=3000; std::vector<std::vector<lint>>binom(max+1,std::vector<lint>(max+1)); binom.at(0).at(0)=1; for(lint i=0;i<max;i++){ for(lint j=0;j<=i;j++){ add_eq(binom.at(i+1).at(j),binom.at(i).at(j)); add_eq(binom.at(i+1).at(j+1),binom.at(i).at(j)); } } lint q;std::cin>>q; while(q--){ lint d,x,t;std::cin>>d>>x>>t; std::cout<<(binom.at(x+d-1).at(d-1)<=t?"AC":"ZETUBOU")<<'\n'; } }