QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#64523#3090. Inverse ProblemTenshiWA 2ms3308kbC++17903b2022-11-24 22:57:512022-11-24 22:57:53

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-11-24 22:57:53]
  • 评测
  • 测评结果:WA
  • 用时:2ms
  • 内存:3308kb
  • [2022-11-24 22:57:51]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
 
#define debug(x) cerr << #x << ": " << (x) << endl
#define rep(i,a,b) for(int i=(a);i<=(b);i++)
#define dwn(i,a,b) for(int i=(a);i>=(b);i--)
#define pb push_back
#define int long long
#define all(x) (x).begin(), (x).end()
#define ma 350005
#define mo 998244353
#define x first
#define y second
using pii = pair<int, int>;
using ll = long long;
 
inline void read(int &x){
    int s=0; x=1;
    char ch=getchar();
    while(ch<'0' || ch>'9') {if(ch=='-')x=-1;ch=getchar();}
    while(ch>='0' && ch<='9') s=(s<<3)+(s<<1)+ch-'0',ch=getchar();
    x*=s;
}
int a[ma],p[ma],ct[ma];
signed main(){
	int n,m,an=1,t1=0,t2=0;read(n);read(m);
	for(int i=1;i<=m;i++)
	{
		read(a[i]);p[a[i]]=1;
		if(i==m)ct[a[i]]++;
		ct[max(a[i],a[i-1])]++;
	}
	for(int i=1;i<=n;i++)if(p[i])t1+=ct[i];else an=an*(t1+t2)%mo,t2++;
	cout<<an;return 0;
}

详细

Test #1:

score: 0
Wrong Answer
time: 2ms
memory: 3308kb

input:

7 2
2 1

output:

2520

result:

wrong answer 1st lines differ - expected: '720', found: '2520'