QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#573000#9310. Permutation Counting 4lnkkerstCompile Error//C++141.5kb2024-09-18 17:02:252024-09-18 17:02:28

Judging History

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

  • [2024-09-18 17:02:28]
  • 评测
  • [2024-09-18 17:02:25]
  • 提交

answer

#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
using namespace std;

#define int long long

#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
using namespace std;

struct Fenwick {
  int n;
  vector<int> a;
  Fenwick(int _n) : n(_n), a(_n + 10) {
  }
  void add(int k, int x) {
    while (k <= n) {
      a[k] += x;
      k += k & -k;
    }
  }
  int query(int k) {
    int res = 0;
    while (k > 0) {
      res += a[k];
      k -= k & -k;
    }
  }
  int query(int l, int r) {
    return query(r) - query(l - 1);
  }
};

void solve() {
}

signed main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  int t = 1;
  cin >> t;
  while (t--) {
    solve();
  }
}

void solve() {
  int n;
  cin >> n;
  cout << (rand() % 2) << endl;
}

signed main() {
  srand(time(0));
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  int t = 1;
  cin >> t;
  while (t--) {
    solve();
  }
}

詳細信息

answer.code: In member function ‘long long int Fenwick::query(long long int)’:
answer.code:54:3: warning: no return statement in function returning non-void [-Wreturn-type]
   54 |   }
      |   ^
answer.code: At global scope:
answer.code:74:6: error: redefinition of ‘void solve()’
   74 | void solve() {
      |      ^~~~~
answer.code:60:6: note: ‘void solve()’ previously defined here
   60 | void solve() {
      |      ^~~~~
answer.code:80:8: error: redefinition of ‘int main()’
   80 | signed main() {
      |        ^~~~
answer.code:63:8: note: ‘int main()’ previously defined here
   63 | signed main() {
      |        ^~~~