QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#201350#5154. ETAnameless_story#Compile Error//C++20995b2023-10-05 13:52:482023-10-05 13:52:48

Judging History

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

  • [2023-10-05 13:52:48]
  • 评测
  • [2023-10-05 13:52:48]
  • 提交

answer

#include"bits/stdc++.h"
using namespace std;
typedef long long ll;
template<class T1,class T2> bool cmin(T1 &x,const T2 &y) { if (y<x) { x=y; return 1; }return 0; }
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 main()
{
	ios::sync_with_stdio(0); cin.tie(0);
	cout<<fixed<<setprecision(15);
	ll n,m; char xxx;
	cin>>n>>xxx>>m;
	if(n<m)
	ll d=10/m;
	m=m*d;
	n=n*d;
	vector a(1,m-1);
	if (n<m-1||n>m*(m-1)/2)
	{
		cout<<"impossible\n";
		return 0;
	}
	ll sum=m-1;
	if (sum<n)
		for (int i=2; i<=m; i++)
		{
			if (sum+m-i<=n)
				sum+=m-i,a.push_back(m-i);
			else
			{
				a.push_back(n-sum);
				sum=n;
				break;
			}
		}
	a.push_back(0);
	int cnt=1,pre=1;
	cout<<m<<'\n';
	for (int i=0; i<a.size()-1; i++)
	{
		ll tp;
		for (int j=1; j<=a[i]-a[i+1]; j++)
		{
			cout<<pre<<' '<<cnt+j<<'\n';
			tp=cnt+j;
		}
		pre=tp;
		cnt+=a[i]-a[i+1];
	}
}
asdfdasf

Details

answer.code: In function ‘int main()’:
answer.code:15:13: error: ‘d’ was not declared in this scope
   15 |         m=m*d;
      |             ^
answer.code: At global scope:
answer.code:51:1: error: ‘asdfdasf’ does not name a type
   51 | asdfdasf
      | ^~~~~~~~