提交记录 13747


用户 题目 状态 得分 用时 内存 语言 代码长度
15iq wc2017b3. 【WC2017】挑战-任务3 Time Limit Exceeded 75 3 s 808 KB C++11 1.15 KB
提交时间 评测时间
2020-08-06 12:28:39 2020-08-06 12:28:46
#include <bits/stdc++.h>

using namespace std;

void *mymove(void *dest, const void *src, size_t num) {
  static unsigned tmp[66668];
  memcpy(tmp, src, num);
  memcpy(dest, tmp, num);
  return dest;
}

unsigned solve(int n, char *s) {
  int nsz = 1;
  unsigned dp[66668] = {1};
  for (int i = 0; i < n; ++i) {
    int sz = min(i + 1, n - i - 1) / 2 + 1;
    if (s[i] == '(') {
      if (i & 1) {
        mymove(dp + 1, dp, (sz - 1) * 4);
        dp[0] = 0;
      }
    } else if (s[i] == ')') {
      if (~i & 1) {
        mymove(dp, dp + 1, sz * 4);
        dp[sz] = 0;
      }
    } else {
      if (i & 1) {
        mymove(dp + 1, dp, sz * 4);
        dp[0] = 0;
        int i;
        for (i = 0; i + 1 < nsz; i += 2) {
          dp[i] += dp[i + 1];
          dp[i + 1] += dp[i + 2];
        }
        for (; i < nsz; ++i) {
          dp[i] += dp[i + 1];
        }
        dp[sz] = 0;
      } else {
        int i;
        for (i = 0; i + 1 < sz; i += 2) {
          dp[i] += dp[i + 1];
          dp[i + 1] += dp[i + 2];
        }
        for (; i < sz; ++i) {
          dp[i] += dp[i + 1];
        }
        dp[sz] = 0;
      }
    }
    nsz = sz;
  }
  return dp[0];
}

CompilationN/AN/ACompile OKScore: N/A

Testcase #1128.35 us296 KBAcceptedScore: 25

Testcase #2738.6 ms528 KBAcceptedScore: 25

Testcase #32.7 s736 KBAcceptedScore: 25

Testcase #43 s808 KBTime Limit ExceededScore: 0


Judge Duck Online | 评测鸭在线
Server Time: 2020-09-25 01:44:37 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用