QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#700631#5253. DenormalizationAshbourneCompile Error//C++23664b2024-11-02 13:15:002024-11-02 13:15:01

Judging History

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

  • [2024-11-02 13:15:01]
  • 评测
  • [2024-11-02 13:15:00]
  • 提交

answer

\#include<bits/stdc++.h>
#define double long double
const double eps = 1e-6;
using namespace std;
signed main(){
	ios::sync_with_stdio(0);
	int n;
	cin >> n;
	vector<double>a(n + 1);
	for(int i = 1; i <= n; ++ i) cin >> a[i];
	double mx = 0.0;
	for(int i = 1; i <= n; ++ i) mx = max(mx, a[i]);
	for(int i = 1; i <= 10000; ++ i){
		double t = i / mx;
		bool flag = 1;
		// if(fabs(round(t * t) - t * t) > eps) continue;
		for(int j = 1; j <= n; ++ j){
			double tt = a[j] * t;
			if(fabs(round(tt) - tt) > eps){
				flag = 0; break;	
			}
		}
		if(flag){
			for(int j = 1; j <= n; ++ j) cout << round(a[j] * t) << endl;
			break;
		}
	}
}

详细

answer.code:1:1: error: stray ‘\’ in program
    1 | \#include<bits/stdc++.h>
      | ^
answer.code:1:2: error: stray ‘#’ in program
    1 | \#include<bits/stdc++.h>
      |  ^
answer.code:1:11: error: ‘bits’ was not declared in this scope
    1 | \#include<bits/stdc++.h>
      |           ^~~~
answer.code:1:16: error: ‘stdc’ was not declared in this scope; did you mean ‘std’?
    1 | \#include<bits/stdc++.h>
      |                ^~~~
      |                std
answer.code:1:11: error: ‘bits’ was not declared in this scope
    1 | \#include<bits/stdc++.h>
      |           ^~~~
answer.code:1:16: error: ‘stdc’ was not declared in this scope; did you mean ‘std’?
    1 | \#include<bits/stdc++.h>
      |                ^~~~
      |                std
answer.code:1:11: error: ‘bits’ was not declared in this scope
    1 | \#include<bits/stdc++.h>
      |           ^~~~
answer.code:1:16: error: ‘stdc’ was not declared in this scope; did you mean ‘std’?
    1 | \#include<bits/stdc++.h>
      |                ^~~~
      |                std
answer.code:1:11: error: ‘bits’ was not declared in this scope
    1 | \#include<bits/stdc++.h>
      |           ^~~~
answer.code:1:16: error: ‘stdc’ was not declared in this scope; did you mean ‘std’?
    1 | \#include<bits/stdc++.h>
      |                ^~~~
      |                std
answer.code:1:11: error: ‘bits’ was not declared in this scope
    1 | \#include<bits/stdc++.h>
      |           ^~~~
answer.code:1:16: error: ‘stdc’ was not declared in this scope; did you mean ‘std’?
    1 | \#include<bits/stdc++.h>
      |                ^~~~
      |                std
answer.code:1:11: error: ‘bits’ was not declared in this scope
    1 | \#include<bits/stdc++.h>
      |           ^~~~
answer.code:1:16: error: ‘stdc’ was not declared in this scope; did you mean ‘std’?
    1 | \#include<bits/stdc++.h>
      |                ^~~~
      |                std
answer.code:1:11: error: ‘bits’ was not declared in this scope
    1 | \#include<bits/stdc++.h>
      |           ^~~~
answer.code:1:16: error: ‘stdc’ was not declared in this scope; did you mean ‘std’?
    1 | \#include<bits/stdc++.h>
      |                ^~~~
      |                std
answer.code:1:11: error: ‘bits’ was not declared in this scope
    1 | \#include<bits/stdc++.h>
      |           ^~~~
answer.code:1:16: error: ‘stdc’ was not declared in this scope; did you mean ‘std’?
    1 | \#include<bits/stdc++.h>
      |                ^~~~
      |                std
answer.code:1:11: error: ‘bits’ was not declared in this scope
    1 | \#include<bits/stdc++.h>
      |           ^~~~
answer.code:1:16: error: ‘stdc’ was not declared in this scope; did you mean ‘std’?
    1 | \#include<bits/stdc++.h>
      |                ^~~~
      |                std
answer.code:1:3: error: ‘include’ does not name a type
    1 | \#include<bits/stdc++.h>
      |   ^~~~~~~
answer.code: In function ‘int main()’:
answer.code:6:9: error: ‘ios’ has not been declared
    6 |         ios::sync_with_stdio(0);
      |         ^~~
answer.code:8:9: error: ‘cin’ was not declared in this scope
    8 |         cin >> n;
      |         ^~~
answer.code:1:1: note: ‘std::cin’ is defined in header ‘<iostream>’; did you forget to ‘#include <iostream>’?
  +++ |+#include <iostream>
    1 | \#include<bits/stdc++.h>
answer.code:9:9: error: ‘vector’ was not declared in this scope
    9 |         vector<double>a(n + 1);
      |         ^~~~~~
answer.code:1:1: note: ‘std::vector’ is defined in header ‘<vector>’; did you forget to ‘#include <vector>’?
  +++ |+#include <vector>
    1 | \#include<bits/stdc++.h>
answer.code:2:16: error: expected primary-expression before ‘long’
    2 | #define double long double
      |                ^~~~
answer.code:9:16: note: in expansion of macro ‘double’
    9 |         vector<double>a(n + 1);
      |                ^~~~~~
answer.code:10:45: error: ‘a’ was not declared in this scope
   10 |         for(int i = 1; i <= n; ++ i) cin >> a[i];
      |                                             ^
answer.code:12:51: error: ‘a’ was not declared in this scope
   12 |         for(int i = 1; i <= n; ++ i) mx = max(mx, a[i]);
      |                                                   ^
answer.code:12:43: error: ‘max’ was not declared in this scope; did you mean ‘mx’?
   12 |         for(int i = 1; i <= n; ++ i) mx = max(mx, a[i]);
      |                                           ^~~
      |                                           mx
answer.code:18:37: error: ‘a’ was not declared in this scope
   18 |                         double tt = a[j] * t;
      |                                     ^
answer.code:19:33: error: ‘round’ was not declared in this scope
   19 |                         if(fabs(round(tt) - tt) > eps){
      |                                 ^~~~~
answer.code:19:28: error: ‘fabs’ was not declared in this scope
   19 |                         if(fabs(round(tt) - tt) > eps){
      |                            ^~~~
...