Submission #637252


Source Code Expand

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <numeric>
#include <stack>
#include <map>
using namespace std;

#define FOR(i,a,b) for(long long int i=(a);i<(b);i++)
#define REP(i,n) for(long long int i=0;i<(n);i++)
#define ALL(s) (s).begin(),(s).end()

#define PI 3.14159265358479

typedef long long ll;

int c = -1;
double  e, g;
char vs[17][5] = { "N", "NNE", "NE", "ENE", "E","ESE", "SE",
"SSE", "S", "SSW", "SW", "WSW", "W", "WNW", "NW", "NNW", "N" }; ];
vector<int> vd{ 0, 15, 93, 201, 327, 477, 645,
831, 1029, 1245, 1467, 1707, 1959 };
string s;
int w;

int main(){
	cin >> e >> g;
	e /= 10;
	cout << g << endl;
	double a = 11.2;
	for (int i = 0;; i++){
		if (g <= 0.2 * 60){
			cout << "c ";
			break;
		}
		if (a > e){
			cout << "N ";
			break;
		}
		if (a < e&&a + 22.5 >= e){
			cout << vs[i + 1] << " ";
			break;
		}
		a += 22.5;
	}
	for (int i = 0; i < 13; i++){
		if (vd[i] <= g){
			c++;
		}
	}
	cout << c << endl;
}

Submission Info

Submission Time
Task C - 風力観測
User jimmy
Language C++ (G++ 4.6.4)
Score 0
Code Size 1088 Byte
Status CE

Compile Error

./Main.cpp:24:65: error: expected unqualified-id before ‘]’ token
./Main.cpp:25:13: warning: extended initializer lists only available with -std=c++0x or -std=gnu++0x [enabled by default]
./Main.cpp:26:35: error: in C++98 ‘vd’ must be initialized by constructor, not by ‘{...}’
./Main.cpp:26:35: error: no matching function for call to ‘std::vector<int>::vector(<brace-enclosed initializer list>)’
./Main.cpp:26:35: note: candidates are:
/usr/include/c++/4.6/bits/stl_vector.h:334:9: note: template<class _InputIterator> std::vector::vector(_InputIterator, _InputIterator, const allocator_type&)
/usr/include/c++/4.6/bits/stl_vector.h:278:7: note: std::vector<_Tp, _Alloc>::vector(const std::vector<_Tp, _Alloc>&) [with _Tp = int, _Alloc = std::allocator<int>, std::vector<_Tp, _Alloc> = std::vector<int>]
/usr/include/c++/4.6/bits/stl_vector.h:278:7: note:   candidate expects 1 argument, 13 provided
/usr/include/c++/4.6/bits/stl_vector.h:263:7: note: std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _All...