QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#701883#7706. Rikka with LinkerTheZoneCompile Error//C++20707b2024-11-02 14:52:052024-11-02 14:52:24

Judging History

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

  • [2024-11-02 14:52:24]
  • 评测
  • [2024-11-02 14:52:05]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
#define FOR(i,s,t) for(int i=(s),_t=(t); i<=_t; ++i)
const int N=19;int f[1<<N|5];int g[N],h[1<<N|5];void solve() {int n,m;
    cin >> n >> m;FOR(i,0,n-1) g[i]=0;FOR(i,1,m) {int x,y;cin >> x >> y;--x,--y;g[x]|=1<<y;}FOR(i,0,(1<<n)-1) f[i]=1e9;f[0]=0;FOR(i,0,(1<<n)-1) {
        FOR(j,0,n-1) h[1<<j]=1;
        FOR(j,0,n-1) if((1<<j)&i) {
            h[g[j]^(g[j]&i)]++;
        }
        FOR(j,0,n-1) if(!((1<<j)&i)) {
            f[i|(1<<j)]=min(f[i|(1<<j)],h[1<<j]+f[i]);}
    cout << f[(1<<n)-1] << '\n';
}
int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int T;
    cin >> T;
    while(T--) solve();
    return 0;
}

详细

answer.code: In function ‘void solve()’:
answer.code:14:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   14 | int main() {
      |         ^~
answer.code:14:9: note: remove parentheses to default-initialize a variable
   14 | int main() {
      |         ^~
      |         --
answer.code:14:9: note: or replace parentheses with braces to value-initialize a variable
answer.code:14:12: error: a function-definition is not allowed here before ‘{’ token
   14 | int main() {
      |            ^
answer.code:21:2: error: expected ‘}’ at end of input
   21 | }
      |  ^
answer.code:4:62: note: to match this ‘{’
    4 | const int N=19;int f[1<<N|5];int g[N],h[1<<N|5];void solve() {int n,m;
      |                                                              ^