結果
問題 |
No.2845 Birthday Pattern in Two Different Calendars
|
ユーザー |
👑 |
提出日時 | 2024-08-24 12:47:52 |
言語 | cLay (20241019-1) |
結果 |
AC
|
実行時間 | 218 ms / 2,000 ms |
コード長 | 300 bytes |
コンパイル時間 | 2,792 ms |
コンパイル使用メモリ | 182,356 KB |
実行使用メモリ | 14,208 KB |
最終ジャッジ日時 | 2024-08-24 12:48:00 |
合計ジャッジ時間 | 6,730 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 22 |
ソースコード
#define U u.erase(a=t),u.erase(s) ll@T;rep(T){ll@K,@--M,@N,A[N]{},t=0,s,b=M;set<ll>u;rep(k,K)u.insert(k);rep[A](a,N){s=(t+M)%K;if(u.count(t)&u.count(s))U;else if(b){b=0;while(u.size()&&!b){t=*u.begin(),s=(t+M)%K;if(b=u.count(s))U;else u.erase(t);}}t=(s+M)%K;}if(b)wt("Yes"),wt(A(N)+1);else wt("No");}