QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#212652#6821. Another A+B Problemnameless_story#Compile Error//C891.2kb2023-10-13 19:03:232023-10-13 19:03:24

Judging History

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

  • [2023-10-13 19:03:24]
  • 评测
  • [2023-10-13 19:03:23]
  • 提交

answer

#include"bits/stdc++.h"
using namespace std;
typedef long long ll;
template<class T1,class T2> bool cmax(T1 &x,const T2 &y) { if (x<y) { x=y; return 1; }return 0; }
#define all(x) (x).begin(),(x).end()
int low[10],hig[10],cnt[10];
int main()
{
	ios::sync_with_stdio(0); cin.tie(0);
	string s,t;
	cin>>s>>t;
	s.erase(s.begin()+5);
	s.erase(s.begin()+2);
	t.erase(t.begin()+5);
	int i,j,k,a,b,c;
	t.erase(t.begin()+2);
	for (i=0; i<6; i++) if (t[i]=='P') ++low[s[i]-'0'];
	for (i=0; i<10; i++) hig[i]=10;
	for (i=0; i<6; i++) if (t[i]=='B') hig[s[i]-'0']=low[s[i]-'0'];
	vector<string> ans;
	for (a=0; a<100; a++) for (b=0; b+a<100; b++)
	{
		int c=a+b;
		string d;
		d+='0'+a/10;
		d+='0'+a%10;
		d+='0'+b/10;
		d+='0'+b%10;
		d+='0'+c/10;
		d+='0'+c%10;
		memset(cnt,0,sizeof cnt);
		for (i=0; i<6; i++) if (d[i]==s[i])
		{
			if (t[i]!='G') break;
		}
		else
		{
			if (t[i]=='G') break;
			++cnt[d[i]-'0'];
		}
		if (i<6) continue;
		for (i=0; i<10; i++) if (cnt[i]<low[i]||cnt[i]>hig[i]) break;
		if (i==10) ans.push_back(d.substr(0,2)+'+'+d.substr(2,2)+'='+d.substr(4));
	}
	cout<<ans.size()<<'\n';
	for (auto &s:ans) cout<<s<<'\n';
}

Details

answer.code:1:9: fatal error: bits/stdc++.h: No such file or directory
    1 | #include"bits/stdc++.h"
      |         ^~~~~~~~~~~~~~~
compilation terminated.