QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#212650#6821. Another A+B Problemnameless_story#Compile Error//C891.4kb2023-10-13 19:01:512023-10-13 19:01:51

Judging History

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

  • [2023-10-13 19:01:51]
  • 评测
  • [2023-10-13 19:01:51]
  • 提交

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;
		string tmp(6,'B');
		memset(cnt,0,sizeof cnt);
		for (i=0; i<6; i++) if (d[i]==s[i]) tmp[i]='G';
		else
		{
			++cnt[d[i]-'0'];
		}
		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';
}
28
11+13=24
11+14=25
11+23=34
11+24=35
11+31=42
11+32=43
11+33=44
11+34=45
11+35=46
11+36=47
11+37=48
11+38=49
11+41=52
11+42=53
11+43=54
11+44=55
11+45=56
11+46=57
11+47=58
11+48=59
11+53=64
11+54=65
11+63=74
11+64=75
11+73=84
11+74=85
11+83=94
11+84=95

Details

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