QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#597892#4276. Balls and HolesrbtreeWA 1ms3788kbC++233.0kb2024-09-28 19:20:452024-09-28 19:20:46

Judging History

你现在查看的是最新测评结果

  • [2024-09-28 19:20:46]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3788kb
  • [2024-09-28 19:20:45]
  • 提交

answer

/* やっと交わった運命線 もう離さない
 * rbtree (https://rbtr.ee)
 * z1qqurat (https://z1qqur.at)
 * Email [email protected]
 
         __    __                            ___                             __
   _____/ /_  / /_________  ___        ____ <  /___ _____ ___  ___________ _/ /_
  / ___/ __ \/ __/ ___/ _ \/ _ \      /_  / / / __ `/ __ `/ / / / ___/ __ `/ __/
 / /  / /_/ / /_/ /  /  __/  __/       / /_/ / /_/ / /_/ / /_/ / /  / /_/ / /_
/_/  /_.___/\__/_/   \___/\___/       /___/_/\__, /\__, /\__,_/_/   \__,_/\__/
                                               /_/   /*/
#include <bits/stdc++.h>
#define __NO_MAIN__ false
constexpr bool MTS = false, SPC_MTS = false;
#define FULL(arg) arg.begin(), arg.end()

// :/

using namespace std;
using tp = long long int;
[[maybe_unused]] constexpr tp ZERO = 0, ONE = 1, INF = -1ull >> 3;
int WITHERING(unsigned long long int);
void MIST();

#if !__NO_MAIN__
int main(int argc,char* argv[]){unsigned long long int t=0,_t=1;if(MTS&&!SPC_MTS
) cin >>_t;MIST();while(t<_t||SPC_MTS){if(WITHERING(++t)!=0)return 0;}return 0;}
#endif
template <typename _Ty> class _Lambda_t {_Ty lexp;public:template<typename __Ty>
_Lambda_t(__Ty&&lexp):lexp(static_cast<__Ty&&>(lexp)){}template<typename... __Ty
>decltype(auto)operator()(__Ty&&...args){return lexp(std::ref(*this),static_cast
<__Ty&&>(args)...); } }; template <typename _Ty> decltype(auto) lexp(_Ty&&l_exp)
{ return _Lambda_t<typename std::decay<_Ty>::type>(static_cast<_Ty&&>(l_exp)); }
template <typename _Ty1, typename _Ty2> bool ckmax(_Ty1& a, const _Ty2& b) { if(
a<b){a=b; return true; } return false; } template <typename _Ty1, typename _Ty2>
bool ckmin(_Ty1&a,const _Ty2&b){if(b < a) { a = b; return true; } return false;}
#ifdef XCODE
#define bg(...){cout<<"["<<__LINE__<<'@'<<++_LT[__LINE__]<<':';BG(__VA_ARGS__);}
size_t _LT[21777]; template<typename _Type>void BG(const _Type&_cur){cout<<' '<<
_cur << ']' <<" <<:"<<std::endl;}template<typename _Type,typename... _Other>void
BG(const _Type& _cur, const _Other& ..._other) {cout<< ' '<<_cur;BG(_other...);}
#else
#define bg(...)
#endif

// :/

// :/

struct STRUGGLE {
   STRUGGLE() {
      cin.tie(nullptr)->sync_with_stdio(false);
   }
   
   ~STRUGGLE() {
   }
} STRUGGLE;

void MIST() {
}

int WITHERING([[maybe_unused]] unsigned long long int TEST_NUMBER) {
   tp n; cin >> n;
   vector<bitset<5003>> a(50);
   for (auto& i : a) i.reset();
   for (tp i = 0; i < n; ++i) {
      tp l; cin >> l;
      while (l--) {
         tp x; cin >> x;
         a[x - 1][i] = true;
      }
   }
   tp ans = 0;
   for (tp i = 1; i < n; ++i) {
      bitset<5003> cur;
      bitset<5003> tar;
      cur.reset();
      tar.reset();
      for (tp j = 0; j < 50; ++j) {
         cur ^= a[j];
         if (a[j][i]) {
            tar ^= cur;
            cur.reset();
         }
      }
      for (tp j = 0; j < i; ++j) {
         if (tar[j]) ++ans;
      }
   }
   cout << ans << '\n';
   return 0;
}

// :\ */

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 3516kb

input:

2
1 1
2 1 2

output:

1

result:

ok 1 number(s): "1"

Test #2:

score: 0
Accepted
time: 0ms
memory: 3524kb

input:

2
2 1 2
2 2 1

output:

0

result:

ok 1 number(s): "0"

Test #3:

score: 0
Accepted
time: 0ms
memory: 3596kb

input:

2
1 1
1 2

output:

1

result:

ok 1 number(s): "1"

Test #4:

score: 0
Accepted
time: 0ms
memory: 3632kb

input:

3
2 3 1
3 3 1 2
3 1 2 3

output:

1

result:

ok 1 number(s): "1"

Test #5:

score: 0
Accepted
time: 0ms
memory: 3788kb

input:

3
2 1 2
2 2 1
2 1 3

output:

0

result:

ok 1 number(s): "0"

Test #6:

score: 0
Accepted
time: 0ms
memory: 3752kb

input:

4
3 2 1 3
1 1
3 3 2 1
3 3 2 1

output:

6

result:

ok 1 number(s): "6"

Test #7:

score: -100
Wrong Answer
time: 0ms
memory: 3628kb

input:

4
1 3
3 3 1 2
3 2 1 3
1 2

output:

3

result:

wrong answer 1st numbers differ - expected: '5', found: '3'