QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#793502#21608. 行列式zhulexuanWA 0ms3572kbC++141.6kb2024-11-29 20:37:172024-11-29 20:37:17

Judging History

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

  • [2024-11-29 20:37:17]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3572kb
  • [2024-11-29 20:37:17]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define inf INT_MAX
#define fr(i,l,r) for (i=(l); i<=(r); i++)
#define rfr(i,l,r) for (i=(l); i>=(r); i--)
template<typename T>inline void read(T &n){
    T w=1; n=0; char ch=getchar();
    while (!isdigit(ch) && ch!=EOF){ if (ch=='-') w=-1; ch=getchar(); }
    while (isdigit(ch) && ch!=EOF){ n=(n<<3)+(n<<1)+(ch&15); ch=getchar(); }
    n*=w;
}
template<typename T>inline void write(T x){
    if (x==0){ putchar('0'); return ; }
    T tmp;
    if (x>0) tmp=x;
    else tmp=-x;
    if (x<0) putchar('-');
    char F[105];
    long long cnt=0;
    while (tmp){
        F[++cnt]=tmp%10+48;
        tmp/=10;
    }
    while (cnt) putchar(F[cnt--]);
}
#define Min(x,y) x = min(x,y)
#define Max(x,y) x = max(x,y)
//基础配置=================================================================================
const ll N = 505, mod = 998244353;
struct Det{
    ll n,ans;
    ll a[N][N];
    ll solve(){
        ll i,j,k;
        ans = 1;
        fr(i,1,n){
            fr(j,i+1,n){
                if (!a[j][i]) continue;
                while (a[i][i]){
                    ll kv = a[j][i]/a[i][i];
                    if (kv){ fr(k,0,n) ( a[j][k] -= kv*a[i][k] ) %=mod; }
                    swap(a[i],a[j]); ans = mod-ans;
                }
                swap(a[i],a[j]); ans = mod-ans;
            }
        }
        fr(i,1,n) ans = ans*a[i][i] %mod;
        ans = (ans%mod+mod)%mod;
        return ans;
    }
}dt;
int main(){
//	freopen(".in","r",stdin);
//	freopen(".out","w",stdout);
    return 0;
}
//g++ a.cpp -o a -Wall -Wl,--stack=512000000 -std=c++11 -O2

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3572kb

input:

494
507979999 844753235 308697058 577366689 725069158 935333779 504374900 25818576 590205152 640101368 622693010 938297920 872742027 301114974 734834637 556531110 842083217 975440662 921805913 100862321 393656903 213191224 795146059 30475198 812681603 711143306 28681751 642978178 605226383 94538558 ...

output:


result:

wrong answer Answer contains longer sequence [length = 1], but output contains 0 elements