結果
| 問題 | No.3376 Rectangle in Circle |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-12-18 11:42:05 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 254 ms / 2,000 ms |
| コード長 | 495 bytes |
| 記録 | |
| コンパイル時間 | 1,048 ms |
| コンパイル使用メモリ | 93,848 KB |
| 実行使用メモリ | 12,928 KB |
| 最終ジャッジ日時 | 2025-12-18 11:42:11 |
| 合計ジャッジ時間 | 6,294 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 20 |
ソースコード
#include <iostream>
#include <atcoder/modint>
#include <set>
using namespace std;using M=atcoder::modint998244353;int main(){int T,N,L,n,m;cin>>T;while(T--){set<int> D;cin>>N>>L;for(m=0;m<N;m++){cin>>n;D.insert(n);}n=0;m=0;for(int d:D)if(L%2==0&&D.contains(d+L/2))n++;else m++;m-=n;M a;if(n<2)for(L=1;L<=N;L++)a+=N/M(L);else{M E1=N/M(n-1),E0=E1+N/M(n);for(L=1;L<n;L++){E1*=L*2/M(L+n-1);E1+=N/M(L+n-1);E0*=L*2/M(L+n);E0+=N/M(L+n);E0+=E1*(n-L)/(n+L);}a=N/M(2*n)+E0;}cout<<a.val()<<'\n';}return 0;}