QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#601855#9307. Clock MasterWrongAnswer_90AC ✓506ms4896kbC++175.0kb2024-09-30 14:44:192024-09-30 14:44:19

Judging History

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

  • [2024-09-30 14:44:19]
  • 评测
  • 测评结果:AC
  • 用时:506ms
  • 内存:4896kb
  • [2024-09-30 14:44:19]
  • 提交

answer

#include<bits/stdc++.h>
#define ull unsigned long long
#define ui unsigned int
#define ld long double
#define ll long long
#define lll __int128
#define fi first
#define se second
#define e emplace
#define eb emplace_back
#define db double
#define ef emplace_front
#define pii pair<int,int>
#define pll pair<ll,ll>
#define vi vector<int>
#define vp vector<pii>
#define vt vector<tup>
#define all(x) x.begin(),x.end()
#define mp make_pair

#define FastI
#define FastO
#define int ll
bool ST;
static const ll MOD=998244353,Phi=998244352,inv2=499122177,Root=3,iRoot=332748118;
static const ll inf=1073741823,Inf=4294967296,INF=4557430888798830399;
static const ld eps=1e-9,pi=3.1415926535;
char in[1<<20],*p1=in,*p2=in;
char out[1<<20],*p3=out;
using namespace std;
struct tup
{
	int x,y,z;
	tup(int X=0,int Y=0,int Z=0)
	{x=X,y=Y,z=Z;}
};
#ifdef FastI
#define getchar() (p1==p2&&(p2=(p1=in)+fread(in,1,1<<20,stdin),p1==p2)?EOF:*p1++)
#endif
#ifdef FastO
#define putchar(x) (p3-out==1<<20?fwrite(out,1,1<<20,stdout),p3=out,0:0,*p3++=x)
#define puts(x) write(x,'\n')
#endif
namespace FastIO
{
	template<typename T> inline void write(T x,char ch=' ')
	{
		if(is_same<char,T>::value)putchar(x);
		else
		{
			if(x<0)x=-x,putchar('-');
			static char st[25];
			int top=0;
			do st[top++]=x%10+'0',x/=10;while(x);
			while(top)putchar(st[--top]);
		}
		ch!='~'?putchar(ch):0;
	}
	inline void write(const char*x,char ch=' ')
	{
		for(int i=0;x[i]!='\0';++i)putchar(x[i]);
		ch!='~'?putchar(ch):0;
	}
	inline void read(char&s){do s=getchar();while(s=='\n'||s==' ');}
	inline void read(char s[])
	{
		int len=0;char st;
		do st=getchar();while(st=='\n'||st==' ');
		s[++len]=st,st=getchar();
		while(st!='\n'&&st!=' ')s[++len]=st,st=getchar();
		s[++len]='\0';
	}
	template<typename T> inline void read(T &s)
	{
		char ch=getchar();s=0;
		while((ch>'9'||ch<'0')&&ch!='-')ch=getchar();
		bool tf=(ch=='-'&&(ch=getchar()));
		while(ch>='0'&&ch<='9')s=(s<<1)+(s<<3)+ch-'0',ch=getchar();
		s=tf?-s:s;
	}
	inline void edl(){putchar('\n');}
	template<typename T1,typename T2> inline void read(pair<T1,T2> &s){read(s.fi),read(s.se);}
	template<typename T,typename...Args> inline void write(T x,Args...args){write(x,'~'),write(args...);}
	template<typename T,typename...Args> inline void read(T&x,Args&...args){read(x),read(args...);}
	#ifdef FastO
	struct Writer{~Writer(){fwrite(out,1,p3-out,stdout);}}Writ;
	#endif
}
using namespace FastIO;
namespace MTool
{
	inline int Cadd(int a,int b){return (ll)a+b>=MOD?(ll)a+b-MOD:a+b;}
	inline int Cdel(int a,int b){return a-b<0?a-b+MOD:a-b;}
	inline int Cmul(int a,int b){return 1ll*a*b%MOD;}
	inline int sqr(int a){return 1ll*a*a%MOD;}
	inline void Madd(int&a,int b){a=((ll)a+b>=MOD?(ll)a+b-MOD:a+b);}
	inline void Mdel(int&a,int b){a=(a-b<0?a-b+MOD:a-b);}
	inline void Mmul(int&a,int b){a=1ll*a*b%MOD;}
	inline int Cmod(int x){return (x%MOD+MOD)%MOD;}
	inline void Mmod(int&x){x=(x%MOD+MOD)%MOD;}
	template<typename T> inline bool Mmax(T&a,T b){return a<b?a=b,1:0;}
	template<typename T> inline bool Mmin(T&a,T b){return a>b?a=b,1:0;}
	template<typename...Args> inline void Madd(int&a,int b,Args...args){Madd(a,b),Madd(a,args...);}
	template<typename...Args> inline void Mmul(int&a,int b,Args...args){Mmul(a,b),Mmul(a,args...);}
	template<typename...Args> inline void Mdel(int&a,int b,Args...args){Mdel(a,b),Mdel(a,args...);}
	template<typename...Args> inline int Cadd(int a,int b,Args...args){return Cadd(Cadd(a,b),args...);}
	template<typename...Args> inline int Cmul(int a,int b,Args...args){return Cmul(Cmul(a,b),args...);}
	template<typename...Args> inline int Cdel(int a,int b,Args...args){return Cdel(Cdel(a,b),args...);}
	template<typename...Args,typename T> inline bool Mmax(T&a,T b,Args...args){return Mmax(a,b)|Mmax(a,args...);}
	template<typename...Args,typename T> inline bool Mmin(T&a,T b,Args...args){return Mmin(a,b)|Mmin(a,args...);}
	inline int power(int x,int y){int s=1;for(;y;y>>=1,Mmul(x,x))if(y&1)Mmul(s,x);return s;}
}
using namespace MTool;
namespace WrongAnswer_90
{
	int pr[30010],cnt;
	long double f[30010];
	bool v[30010];
	inline void mian()
	{
		for(int i=2;i<=30000;++i)
		{
			if(!v[i])pr[++cnt]=i;
			for(int j=1;j<=cnt&&i*pr[j]<=30000;++j)
			{
				v[i*pr[j]]=1;
				if(i%pr[j]==0)break;
			}
		}
		for(int i=1;i<=cnt;++i)
		{
			for(int k=30000;k>=1;--k)
			{
				for(int j=pr[i];j<=k;j*=pr[i])
				Mmax(f[k],f[k-j]+log(j));
			}
		}
		for(int i=2;i<=30000;++i)
		f[i]=max(f[i],f[i-1]);
//		for(int i=1;i<=30000;++i)printf("%.7Lf\n",f[i]);
		int T,n;
		read(T);
		while(T--)read(n),printf("%.7Lf\n",f[n]);
	}
	inline void Mian()
	{
		int T=1;
//		read(T);
		while(T--)mian();
	}
}
bool ED;
signed main()
{
//	freopen("1.in","r",stdin);
//	freopen("1.out","w",stdout);
	double st=clock();
	WrongAnswer_90::Mian();
	double ed=clock();
 	cerr<<endl;
 	cerr<<"Time: "<<ed-st<<" ms\n";
 	cerr<<"Memory: "<<abs(&ST-&ED)/1024.0/1024.0<<" MB\n";
	return 0;
}

这程序好像有点Bug,我给组数据试试?

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 495ms
memory: 4660kb

input:

3
2
7
10

output:

0.6931472
2.4849066
3.4011974

result:

ok 3 numbers

Test #2:

score: 0
Accepted
time: 491ms
memory: 4720kb

input:

5000
580
4555
4654
1420
53
1076
1226
2733
2285
348
2104
2293
3447
4208
710
307
1763
1142
3027
2151
3182
1546
3398
867
2380
830
4211
3117
3058
2251
1890
3961
4003
3991
4167
4976
1765
3235
2644
4070
4644
3645
875
3005
4769
4934
3846
2941
255
946
4164
1372
1193
3056
4472
508
3949
2473
4490
88
4014
2953...

output:

59.8085219
202.4405258
204.2875989
102.5147878
12.7948588
87.1121777
94.2896330
150.9394242
135.9314246
44.1382733
130.2343311
135.9907012
171.9425162
192.9350065
67.6519848
40.4247012
116.7014833
90.4617923
159.8342658
131.0247772
164.2250183
108.2830796
170.8792016
76.8254537
139.4929377
74.522868...

result:

ok 5000 numbers

Test #3:

score: 0
Accepted
time: 500ms
memory: 4816kb

input:

30000
14727
26896
6571
17234
3891
15888
13803
8818
11068
5541
24029
24764
15463
20613
8526
102
23759
10980
24923
19706
25043
2014
15199
19085
5761
24243
2075
16490
695
29219
2397
17193
25700
12082
13253
4167
5329
23855
6274
13900
26056
2910
28712
13016
9531
3368
17801
24668
23566
28589
1630
29223
24...

output:

391.3137529
546.9251079
248.6141707
426.7012673
183.8731017
407.6267077
377.4640531
293.7069705
333.3052600
225.3412923
514.1094321
522.8216212
401.5757087
472.1779295
288.0294696
19.9162459
510.9588351
332.0720453
524.4400376
460.5810628
526.2428265
126.0977842
398.1034676
451.8726441
230.7408172
5...

result:

ok 30000 numbers

Test #4:

score: 0
Accepted
time: 504ms
memory: 4816kb

input:

30000
7303
9397
29807
14117
26079
521
24880
13348
3507
2730
12948
24124
11931
20353
2972
8842
2822
6482
28198
11160
20228
9360
22739
10345
6523
10943
1290
7656
25686
25672
5920
8709
21244
28654
14891
6931
13149
6285
25615
5220
26475
3569
4878
19879
17324
26596
20869
29746
22377
27326
10043
3099
1425...

output:

263.7071924
303.9239550
578.3318607
381.7893978
538.1656639
56.2969765
523.9402415
369.8987858
173.3581381
150.4442899
363.8982106
515.4957265
347.8439993
468.0862983
157.8189637
294.3680636
153.3941171
246.3031120
561.4910484
334.9735571
467.4017533
303.4752733
498.4962631
321.1429912
247.3448525
3...

result:

ok 30000 numbers

Test #5:

score: 0
Accepted
time: 503ms
memory: 4896kb

input:

30000
20346
25684
25448
20568
28450
22513
24535
22174
27365
29390
29947
26968
24429
29299
22646
24327
20884
28665
28165
26338
24932
24668
26276
26758
20761
20643
22023
21015
25086
24814
29117
20105
23995
25805
24808
26211
23715
20272
24108
21876
25946
20128
26304
27341
21729
28712
28003
29471
24643
...

output:

468.0609269
533.0405798
530.3961797
471.3197584
564.2890750
496.0666576
520.0112069
492.1447788
551.8060123
574.2733841
580.5930775
548.0635805
518.6007821
573.5318020
497.7392329
517.5106295
475.0111429
566.4380337
561.4356249
540.9725830
524.4971960
521.7891458
540.0704018
545.2904992
473.6932917
...

result:

ok 30000 numbers

Test #6:

score: 0
Accepted
time: 506ms
memory: 4748kb

input:

30000
29955
29983
29952
29905
29951
29929
29972
29954
29925
29932
29973
29965
29965
29963
29978
29914
29942
29906
29975
29901
29911
29952
29957
29903
29982
29982
29960
29917
29937
29915
29936
29976
29989
29900
29926
29923
29922
29976
29905
29995
29901
29952
29968
29954
29932
29971
29975
29936
29906
...

output:

580.6068102
580.6576162
580.6042227
579.9383046
580.6003074
580.5634701
580.6394998
580.6068102
579.9754986
580.5668034
580.6394998
580.6246097
580.6246097
580.6202107
580.6494336
579.9562864
580.5870402
579.9412986
580.6420526
579.9314625
579.9489054
580.6042227
580.6103746
579.9356382
580.6576162
...

result:

ok 30000 numbers

Extra Test:

score: 0
Extra Test Passed