QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#482439#9115. Contour Multiplicationucup-team2307#Compile Error//C++201.3kb2024-07-17 19:35:252024-07-17 19:35:26

Judging History

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

  • [2024-07-17 19:35:26]
  • 评测
  • [2024-07-17 19:35:25]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;

using ll = long long;
#define int ll
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
using pii = pair<int, int>;
using vi = vector<int>;
#define fi first
#define se second
#define pb push_back

const int N = 18;

mt19937 rng(time(0));
int mul[1<<N][N+1];

signed main()
{
    cin.tie(0)->sync_with_stdio(0);
    cin.exceptions(cin.failbit);

    int n, m, k;
    cin>>n>>m>>k;
    for (int i=0; i<(1<<n); i++)
        for (int j=0; j<=n; j++)
            mul[i][j] = 1;
    for (int i=1; i<=k; i++)
    {
//        c = rng()%(1<<n);
//        d = rng()%(n+1);
//        x = rng()%m;
        cin>>c>>d>>x;
        mul[c][d] = (mul[c][d] * x) % m;
    }
    for (int i=n-1; i>=0; i--)
    {

//        cout<<i<<":\n";
        for (int cnt=0; cnt<=i+1; cnt++)
        for (int mask=0; mask<(1<<n); mask++)
        {
//            cout<<mask<<" "<<cnt<<" "<<mul[mask][cnt]<<"\n";
            if (cnt >= 1)
            {

                mul[mask^(1<<i)][cnt-1] = (mul[mask^(1<<i)][cnt-1] * mul[mask][cnt])%m;
            }
         }
    }

    for (int i=0; i<(1<<n); i++)
        cout<<mul[i][0]<<" ";
    cout<<"\n";
}

Details

answer.code: In function ‘int main()’:
answer.code:35:14: error: ‘c’ was not declared in this scope
   35 |         cin>>c>>d>>x;
      |              ^
answer.code:35:17: error: ‘d’ was not declared in this scope
   35 |         cin>>c>>d>>x;
      |                 ^
answer.code:35:20: error: ‘x’ was not declared in this scope
   35 |         cin>>c>>d>>x;
      |                    ^