QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#188284#4913. 子集匹配hos_lyric#45 95ms4764kbC++141.5kb2023-09-25 18:15:382024-07-04 02:09:23

Judging History

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

  • [2024-07-04 02:09:23]
  • 评测
  • 测评结果:45
  • 用时:95ms
  • 内存:4764kb
  • [2023-09-25 18:15:38]
  • 提交

answer

#include "hall.h"

#include <cassert>
#include <cmath>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <functional>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

using namespace std;

using Int = long long;

template <class T1, class T2> ostream &operator<<(ostream &os, const pair<T1, T2> &a) { return os << "(" << a.first << ", " << a.second << ")"; };
template <class T> ostream &operator<<(ostream &os, const vector<T> &as) { const int sz = as.size(); os << "["; for (int i = 0; i < sz; ++i) { if (i >= 256) { os << ", ..."; break; } if (i > 0) { os << ", "; } os << as[i]; } return os << "]"; }
template <class T> void pv(T a, T b) { for (T i = a; i != b; ++i) cerr << *i << " "; cerr << endl; }
template <class T> bool chmin(T &t, const T &f) { if (t > f) { t = f; return true; } return false; }
template <class T> bool chmax(T &t, const T &f) { if (t < f) { t = f; return true; } return false; }
#define COLOR(s) ("\x1b[" s "m")


int solve(int N, int K, int S) {
  int sum = 0;
  for (int i = 0; i < N; ++i) if (S >> i & 1) {
    sum += i;
  }
  sum %= K;
  int k = 0;
  for (int i = 0; i < N; ++i) if (S >> i & 1) {
    if (k++ == sum) return S ^ (1 << i);
  }
  assert(false);
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 5
Accepted
time: 1ms
memory: 3756kb

input:

14 8

output:

OK

result:

ok "OK"

Test #2:

score: 5
Accepted
time: 1ms
memory: 3900kb

input:

15 8

output:

OK

result:

ok "OK"

Test #3:

score: 5
Accepted
time: 1ms
memory: 3748kb

input:

15 9

output:

OK

result:

ok "OK"

Test #4:

score: 5
Accepted
time: 1ms
memory: 3944kb

input:

15 10

output:

OK

result:

ok "OK"

Test #5:

score: 5
Accepted
time: 3ms
memory: 3712kb

input:

18 10

output:

OK

result:

ok "OK"

Test #6:

score: 5
Accepted
time: 6ms
memory: 4040kb

input:

19 10

output:

OK

result:

ok "OK"

Test #7:

score: 5
Accepted
time: 5ms
memory: 4028kb

input:

19 11

output:

OK

result:

ok "OK"

Test #8:

score: 5
Accepted
time: 3ms
memory: 3996kb

input:

19 12

output:

OK

result:

ok "OK"

Test #9:

score: 5
Accepted
time: 34ms
memory: 4320kb

input:

22 12

output:

OK

result:

ok "OK"

Test #10:

score: 0
Wrong Answer
time: 95ms
memory: 4764kb

input:

23 12

output:


result:

wrong output format Output file not found: ""

Test #11:

score: 0
Judgement Failed

input:

23 13

output:


result:


Test #12:

score: 0
Judgement Failed

input:

23 14

output:


result:


Test #13:

score: 0
Judgement Failed

input:

24 13

output:


result:


Test #14:

score: 0
Judgement Failed

input:

25 13

output:


result:


Test #15:

score: 0
Judgement Failed

input:

25 14

output:


result:


Test #16:

score: 0
Judgement Failed

input:

25 15

output:


result:


Test #17:

score: 0
Judgement Failed

input:

26 14

output:


result:


Test #18:

score: 0
Judgement Failed

input:

27 14

output:


result:


Test #19:

score: 0
Judgement Failed

input:

27 15

output:


result:


Test #20:

score: 0
Judgement Failed

input:

27 16

output:


result: