Submission #637250
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; vector<string> vs{ { "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 | 1155 Byte |
Status | CE |
Compile Error
./Main.cpp:23:16: warning: extended initializer lists only available with -std=c++0x or -std=gnu++0x [enabled by default] ./Main.cpp:25:50: error: in C++98 ‘vs’ must be initialized by constructor, not by ‘{...}’ ./Main.cpp:25:50: error: deducing from brace-enclosed initializer list requires #include <initializer_list> ./Main.cpp:25:50: error: deducing from brace-enclosed initializer list requires #include <initializer_list> ./Main.cpp:25:50: warning: extended initializer lists only available with -std=c++0x or -std=gnu++0x [enabled by default] ./Main.cpp:25:50: error: no matching function for call to ‘std::vector<std::basic_string<char> >::vector(<brace-enclosed initializer list>)’ ./Main.cpp:25:50: 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...