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

Compiler report

input/code.cpp: In function 'int main()':
input/code.cpp:9:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    9 |         cin>>n;
      |         ^~~
      |         std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:75,
                 from input/code.cpp:1:
/usr/include/c++/11/iostream:60:18: note: 'std::cin' declared here
   60 |   extern istream cin;           /// Linked to standard input
      |                  ^~~
input/code.cpp:25:33: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   25 |                                 cout<<"? ";
      |                                 ^~~~
      |                                 std::cout
In file included from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:75,
                 from input/code.cpp:1:
/usr/include/c++/11/iostream:61:18: note: 'std::cout' declared here
   61 |   extern ostream cout;          /// Linked to standard output
      |...

Code

#include<bits/stdc++.h>
//7.0376,7.01368,6.85114,6.56505,6.18824,5.73395,5.21389,4.70021,4.25257,3.91704,3.65402,3.44092,3.25984,3.12948,3.07786,3.19599,3.53435,4.00643,4.57569,5.16924,5.71639,6.1959,6.59646,
double avr[13]={6.87665,7.02117,6.99981,6.83542,6.56518,6.18879,5.73048,5.23796,4.72421,4.2752,3.93959,3.68037,3.46729};
double df[13];
double a[25],diff[25];
int n;

int main(){
	cin>>n;
	for(int i=0;i<12;i++){
		df[i]=avr[i+1]-avr[i];
	}
	while(n--){	
		for(int i=0;i<24;i++){
			cin>>a[i];
		}
		for(int i=0;i<23;i++){
			diff[i]=a[i+1]-a[i];
		}
		
		double x=a[23];
		for(int i=0;i<12;i++){
			x+=(df[i]*7+diff[i]*1)/8;
			if(x-a[i]>2.05){
				cout<<"? ";
				continue;
			}
			cout<<x<<" ";
		}
		cout<<endl;
	}
}