Submission #1357802

#TimeUsernameProblemLanguageResultExecution timeMemory
1357802vjudge1A Plus B (IOI23_aplusb)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;
int mod = 1e9+7;
bitset<25> a[25];
int dp[25][(1<<20)+5];
int main() {
    ios_base::sync_with_stdio(0),cin.tie(0);
    int n;cin>>n;
    for(int i = 0 ; i<n ; ++i) {
        for(int j = 0 ; j<n ; ++j) {
            bool b;cin>>b;
            a[i][j] = b;
        }
    }
    for(int j = 0 ; j<n ; ++j) dp[0][(1<<j)] = a[0][j];
    for(int i = 0 ; i<n-1 ; ++i) {
        for(int now = 0 ; now < (1<<n) ; ++now) {
            for(int j = 0 ; j<n ; ++j) {
                if(now&(1<<j)||!a[i+1][j]) continue;
                dp[i+1][now^(1<<j)] += dp[i][now];
                if(dp[i+1][now^(1<<j)] >= mod) dp[i+1][now^(1<<j)] -= mod;
            }
        }
    }

    cout << dp[n-1][(1<<n)-1] << "\n";
}

Compilation message (stderr)

/usr/bin/ld: /tmp/ccAefkQP.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/cc84GzPB.o:aplusb.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/ccAefkQP.o: in function `main':
grader.cpp:(.text.startup+0x249): undefined reference to `smallest_sums(int, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status