結果
| 問題 | No.767 配られたジャパリまん |
| コンテスト | |
| ユーザー |
👑 tails
|
| 提出日時 | 2018-12-15 02:22:45 |
| 言語 | cLay (20241019-1 + boost 1.89.0) |
| 結果 |
CE
|
| 実行時間 | - |
| コード長 | 700 bytes |
| 記録 | |
| コンパイル時間 | 4,757 ms |
| コンパイル使用メモリ | 170,516 KB |
| 最終ジャッジ日時 | 2024-07-05 13:14:28 |
| 合計ジャッジ時間 | 5,948 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:1014:42: error: ambiguous overload for ‘operator-’ (operand types are ‘unsigned int’ and ‘mint’)
1014 | r+=(__builtin_parity(i^j)?c[j]:MD-c[j]);
| ^~~~~
| |
| mint
main.cpp:1014:42: note: candidate: ‘operator-(unsigned int, long long int)’ (built-in)
1014 | r+=(__builtin_parity(i^j)?c[j]:MD-c[j]);
| ^
main.cpp:1014:42: note: candidate: ‘operator-(unsigned int, int)’ (built-in)
main.cpp:791:6: note: candidate: ‘mint operator-(int, mint)’
791 | mint operator-(int a, mint b){
| ^~~~~~~~
main.cpp:803:6: note: candidate: ‘mint operator-(long long int, mint)’
803 | mint operator-(long long a, mint b){
| ^~~~~~~~
ソースコード
#define MD 100000007
int h,w,k;
int a[20],b[20];
mint c[1<<20];
int sorted_a[20],sorted_b[20],sorted_i[20];
{
combination_mint cm;
cm.init(2d5);
rd(h,w,k,(a,b)(k));
copy(a,a+k,sorted_a);
copy(b,b+k,sorted_b);
sorted_i[0..k]=(0..);
sortA(k,sorted_a,sorted_b,sorted_i);
rep(i,1<<k){
mint r;
int pa=0,pb=0;
r=__builtin_parity(i)?MD-1:1;
rep(j,k){
if(i&1<<sorted_i[j]){
int qa,qb,y,x;
qa=sorted_a[j];
qb=sorted_b[j];
y=qa-pa, x=qb-pb;
r*=x<0?mint(0):cm.C(y+x,y);
pa=qa, pb=qb;
}
}
{
int y,x;
y=h-pa;
x=w-pb;
r*=cm.C(y+x,y);
}
rep(j,i){
if((j&i)==j){
r+=(__builtin_parity(i^j)?c[j]:MD-c[j]);
}
}
c[i]=r;
wt(r);
}
}
tails