提交记录 13752


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

using namespace std;

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) {
        int i;
        for (i = sz - 2; i - 1 >= 0; i -= 2) {
          dp[i + 1] = dp[i];
          dp[i] = dp[i - 1];
        }
        for (; i >= 0; --i) {
          dp[i + 1] = dp[i];
        }
        dp[0] = 0;
      }
    } else if (s[i] == ')') {
      if (~i & 1) {
        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;
      }
    } else {
      if (i & 1) {
        int i;
        for (i = sz - 1; i - 1 >= 0; i -= 2) {
          dp[i + 1] = dp[i];
          dp[i] = dp[i - 1];
        }
        for (; i >= 0; --i) {
          dp[i + 1] = dp[i];
        }
        dp[0] = 0;
        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 #1133.31 us288 KBAcceptedScore: 25

Testcase #2830.471 ms404 KBAcceptedScore: 25

Testcase #32.939 s508 KBAcceptedScore: 25

Testcase #43 s544 KBTime Limit ExceededScore: 0


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