QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#102527#5252. DeforestationguduRE 0ms0kbC++14896b2023-05-03 14:25:402023-05-03 14:25:41

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-05-03 14:25:41]
  • 评测
  • 测评结果:RE
  • 用时:0ms
  • 内存:0kb
  • [2023-05-03 14:25:40]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define M (998244353)
#define N (10010)
double mi,a[N],b[N];
int n,nn;

int main(){ 
	scanf("%d",&n); mi=1; 
	for (int i=1;i<=n;++i){
		scanf("%lf",&a[i]);
		if (a[i]<mi) mi=a[i];
	}
	for (int i=1;i<=n;++i) a[i]/=mi;
//	b[++nn]=1;
//	for (int i=1;i<=n;++i){
//		bool flag=true;
//		for (int j=1;j<=nn;++j){
//			bool t1=abs((a[i]/b[j])-round(a[i]/b[j]))<1e-6;
////			bool t2=1-((a[i]/b[j])-(int)(a[i]/b[j]))<1e-6;
//			if (t1) flag=false;
//		}
//		if (flag) b[++nn]=a[i]; 
//	}
	for (int i=1;i<=10000;++i){
		bool flag=true;
		for (int j=1;j<=n;++j){
			bool t1=abs((a[j]*i)-round(a[j]*i))<1e-4;
//			bool t2=1-((a[i]*i)-(int)(a[i]*i))<1e-6;
			if (!t1){
				flag=false; 
				break;
			}
		}
		if (flag){
			for (int j=1;j<=n;++j) printf("%d\n",(int)round(a[j]*i));
			return 0;
		}
	}
}

詳細信息

Test #1:

score: 0
Runtime Error

input:

999900000
7339 3
14947 2
12850 3
8986 10
11599 9
8889 10
10711 4
8015 1
11626 0
9492 1
7017 0
8863 0
8632 0
5321 5
9906 0
11687 0
9845 0
10469 0
11708 0
14950 5
11934 0
11922 0
13101 0
12000 0
9082 0
9273 5
12296 0
6119 0
9201 0
12652 0
12957 0
7454 5
12515 0
12976 0
10358 0
13997 0
8371 0
10181 5
8...

output:


result: