CSES - Datatähti 2024 alku - Results
Submission details
Task:Säähavainnot
Sender:maweiyin24562
Submission time:2023-11-12 23:47:20 +0200
Language:C++ (C++11)
Status:COMPILE ERROR

Compiler report

input/code.cpp: In function 'int main()':
input/code.cpp:17:24: warning: unused variable 'minerr' [-Wunused-variable]
   17 |                 double minerr=9999.9;
      |                        ^~~~~~
input/code.cpp:29:24: warning: unused variable 'err' [-Wunused-variable]
   29 |                 double err=0;
      |                        ^~~
input/code.cpp:30:21: warning: unused variable 'id' [-Wunused-variable]
   30 |                 int id;
      |                     ^~
input/code.cpp:44:10: error: expected '}' at end of input
   44 |         }
      |          ^
input/code.cpp:14:11: note: to match this '{'
   14 | int main(){
      |           ^

Code

#include<bits/stdc++.h>
using namespace std;
 
double b[12]={
    -0.1,-0.1,-0.1,-0.1,-0.1,-0.1,0,0.1,0,0.1,0.1,0.1,
};
double bb[12]={
    -1,-1,-1,-1,-1,-1,0,1,0,1,1,1,
};
 
double a[25],diff[25];
int n;
 
int main(){
	cin>>n;
	while(n--){
		double minerr=9999.9;		
		for(int i=0;i<24;i++){
			cin>>a[i];
		}
		double avrdf=0;
		for(int i=0;i<23;i++){
			diff[i]=a[i+1]-a[i];
			avrdf+=diff[i];
		}
		avrdf/=23;
		
		
		double err=0;
		int id;
		
		
//		double df=a[0]-a[23]-b[id][0];
		double x=a[23];
		for(int i=0;i<12;i++){
			x+=(b[i]*3+diff[i])/4;
			if(x-a[i]>2.2){
				cout<<"? ";
				continue;
			}
			cout<<x<<" ";
		}
		cout<<endl;
	}