QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#782736#8049. Equal SumshhironCompile Error//C++141.3kb2024-11-25 21:12:412024-11-25 21:12:52

Judging History

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

  • [2024-11-25 21:12:52]
  • 评测
  • [2024-11-25 21:12:41]
  • 提交

answer

#include<bits/stdc++.h>
#define INF 0x7fffffff
#define int long long
typedef long long ll;
using namespace std;
const int MOD=998244353;
const int N=1205;
int n,m,al[N],ar[N],bl[N],br[N];
int f[2][N][N],pre1[N],pre2[N];
signed main(){
	scanf("%lld%lld",&n,&m);
	for(int i=1;i<=n;i++) scanf("%lld%lld",&al[i],&ar[i]);
	for(int i=1;i<=m;i++) scanf("%lld%lld",&bl[i],&br[i]);
	f[0][0][500]=1;
	for(int i=0;i<=n;i++){
		int tag=i&1;
		if(i) for(int j=0;j<=m;j++)
			for(int v=1;v<=1000;v++) f[tag][j][v]=0;
		for(int j=0;j<=m;j++){
			pre1[0]=f[(tag^1)][j][0];
			if(i) for(int v=1;v<=500;v++) pre1[v]=(pre1[v-1]+f[(tag^1)][j][v])%MOD;
			pre2[500]=0;
			if(j) for(int v=501;v<=1000;v++) pre2[v]=(pre2[v-1]+f[tag][j-1][v])%MOD;
			int l=0,r=0;
			if(i) for(int v=0;v<=1000;v++){
				l=max(0,min(v-ar[i]-1,500)),r=max(0,min(v-al[i],500));
				f[tag][j][v]=(f[tag][j][v]+pre1[r]-pre1[l]+MOD)%MOD;
			}
			if(j) for(int v=1000;v>=0;v--){
				l=min(1000,max(v+bl[j]-1,500)),r=min(1000,max(v+br[j],500));
				f[tag][j][v]=(f[tag][j][v]+pre2[r]-pre2[l]+MOD)%MOD;
			}
//			if(i==1&&j==1){
//				for(int v=500;v<=1000;v++) cout<<pre2[v]<<" ";
//				cout<<endl;
//				cout<<f[tag][j][501]<<":"<<pre2[1000]<<endl; 
//			} 
			if(i&&j) printf("%lld ",f[tag][j][500]);
		}if(i) printf("\n");
	}
	return 0;
}/*
1 1
1 1 
1 1
*/

Details

answer.code: In function ‘int main()’:
answer.code:26:44: error: no matching function for call to ‘min(long long int, int)’
   26 |                                 l=max(0,min(v-ar[i]-1,500)),r=max(0,min(v-al[i],500));
      |                                         ~~~^~~~~~~~~~~~~~~
In file included from /usr/include/c++/13/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:51,
                 from answer.code:1:
/usr/include/c++/13/bits/stl_algobase.h:233:5: note: candidate: ‘template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)’
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/13/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
answer.code:26:44: note:   deduced conflicting types for parameter ‘const _Tp’ (‘long long int’ and ‘int’)
   26 |                                 l=max(0,min(v-ar[i]-1,500)),r=max(0,min(v-al[i],500));
      |                                         ~~~^~~~~~~~~~~~~~~
/usr/include/c++/13/bits/stl_algobase.h:281:5: note: candidate: ‘template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)’
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/13/bits/stl_algobase.h:281:5: note:   template argument deduction/substitution failed:
answer.code:26:44: note:   deduced conflicting types for parameter ‘const _Tp’ (‘long long int’ and ‘int’)
   26 |                                 l=max(0,min(v-ar[i]-1,500)),r=max(0,min(v-al[i],500));
      |                                         ~~~^~~~~~~~~~~~~~~
In file included from /usr/include/c++/13/algorithm:61:
/usr/include/c++/13/bits/stl_algo.h:5775:5: note: candidate: ‘template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)’
 5775 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/13/bits/stl_algo.h:5775:5: note:   template argument deduction/substitution failed:
answer.code:26:44: note:   mismatched types ‘std::initializer_list<_Tp>’ and ‘long long int’
   26 |                                 l=max(0,min(v-ar[i]-1,500)),r=max(0,min(v-al[i],500));
      |                                         ~~~^~~~~~~~~~~~~~~
/usr/include/c++/13/bits/stl_algo.h:5785:5: note: candidate: ‘template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)’
 5785 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/13/bits/stl_algo.h:5785:5: note:   template argument deduction/substitution failed:
answer.code:26:44: note:   mismatched types ‘std::initializer_list<_Tp>’ and ‘long long int’
   26 |                                 l=max(0,min(v-ar[i]-1,500)),r=max(0,min(v-al[i],500));
      |                                         ~~~^~~~~~~~~~~~~~~
answer.code:26:72: error: no matching function for call to ‘min(long long int, int)’
   26 |                                 l=max(0,min(v-ar[i]-1,500)),r=max(0,min(v-al[i],500));
      |                                                                     ~~~^~~~~~~~~~~~~
/usr/include/c++/13/bits/stl_algobase.h:233:5: note: candidate: ‘template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)’
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/13/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
answer.code:26:72: note:   deduced conflicting types for parameter ‘const _Tp’ (‘long long int’ and ‘int’)
   26 |                                 l=max(0,min(v-ar[i]-1,500)),r=max(0,min(v-al[i],500));
      |                                                                     ~~~^~~~~~~~~~~~~
/usr/include/c++/13/bits/stl_algobase.h:281:5: note: candidate: ‘template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)’
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/13/bits/stl_algobase.h:281:5: note:   template argument deduction/substitution failed:
answer.code:26:72: note:   deduced conflicting types for parameter ‘const _Tp’ (‘long long int’ and ‘int’)
   26 |                                 l=max(0,min(v-ar[i]-1,500)),r=max(0,min(v-al[i],500));
      |                                                                     ~~~^~~~~~~~~~~~~
/usr/include/c++/13/bits/stl_algo.h:5775:5: note: candidate: ‘template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)’
 5775 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/13/bits/stl_algo.h:5775:5: note:   template argument deduction/substitution failed:
answer.code:26:72: note:   mismatched types ‘std::initializer_list<_Tp>’ and ‘long long int’
   26 |                                 l=max(0,min(v-ar[i]-1,500)),r=max(0,min(v-al[i],500));
      |                                                                     ~~~^~~~~~~~~~~~~
/usr/include/c++/13/bits/stl_algo.h:5785:5: note: candidate: ‘templa...