Submission #108482
Source Code Expand
#include "stdio.h" #include <iostream> #define FOR(i,a,b) for(int i=(a);i<(b);++i) #define REP(i,n) FOR(i,0,n) #define dump(x) cerr << #x << " = " << (x) << endl; #define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl; using namespace std; int solve1(double x) { int r = 0; if (0.0 <= x && x <= 0.2) r = 0; else if (0.3 <= x && x <= 1.5) r = 1; else if (1.6 <= x && x <= 3.3) r = 2; else if (3.4 <= x && x <= 5.4) r = 3; else if (5.5 <= x && x <= 7.9) r = 4; else if (8.0 <= x && x <= 10.7) r = 5; else if (10.8 <= x && x <= 13.8) r = 6; else if (13.9 <= x && x <= 17.1) r = 7; else if (17.2 <= x && x <= 20.7) r = 8; else if (20.8 <= x && x <= 24.4) r = 9; else if (24.5 <= x && x <= 28.4)r = 10; else if (28.5 <= x && x <= 32.6) r = 11; else if (32.7 <= x) r = 12; return r; } string solve2(double x){ string r; if (168.75 <= x && 191.25 > x) r = "S"; else if (11.25 <= x && 33.75 > x)r ="NNE" ; else if(191.25 <= x && 213.75 > x)r ="SSW" ; else if(33.75 <= x && 56.25 > x )r ="NE" ; else if(213.75 <= x && 236.25 > x)r ="SW" ; else if(56.25 <= x && 78.75 > x )r ="ENE" ; else if(236.25 <= x && 258.75 > x)r ="WSW" ; else if(78.75 <= x && 101.25 > x )r ="E" ; else if(258.75 <= x && 281.25 > x)r ="W" ; else if(101.25 <= x && 123.75 > x )r ="ESE" ; else if(281.25 <= x && 303.75 > x)r ="WNW" ; else if(123.75 <= x && 146.25 > x )r ="SE" ; else if(303.75 <= x && 326.25 > x)r ="NW" ; else if(146.25 <= x && 168.75 > x )r ="SSE" ; else if(326.25 <= x && 348.75 > x)r ="NNW" ; else r = "N"; return r; } int main(){ int x, y; scanf("%d%d", &x, &y); // debug(x1); double x1 = (double)x /10,y1 = (double)y; int r1 = solve1(x1); string r2 = (r1 == 0) ? "C": solve2(y1); cout << r2 << " " << r1 << endl; return 0; }
Submission Info
Submission Time | |
---|---|
Task | A - 積雪深差 |
User | pogin503 |
Language | C++ (G++ 4.6.4) |
Score | 0 |
Code Size | 1994 Byte |
Status | WA |
Exec Time | 26 ms |
Memory | 920 KB |
Compile Error
./Main.cpp: In function ‘int main()’: ./Main.cpp:51:26: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
Judge Result
Set Name | all | ||
---|---|---|---|
Score / Max Score | 0 / 100 | ||
Status |
|
Set Name | Test Cases |
---|---|
all | 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, test_01.txt, test_02.txt, test_03.txt, test_04.txt, test_05.txt, test_06.txt, test_07.txt, test_08.txt, test_09.txt, test_10.txt, test_11.txt, test_12.txt, test_13.txt, test_14.txt, test_15.txt, test_16.txt, test_17.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
00_sample_01.txt | WA | 21 ms | 800 KB |
00_sample_02.txt | WA | 24 ms | 800 KB |
00_sample_03.txt | WA | 25 ms | 796 KB |
test_01.txt | WA | 21 ms | 920 KB |
test_02.txt | WA | 22 ms | 752 KB |
test_03.txt | WA | 23 ms | 696 KB |
test_04.txt | WA | 21 ms | 796 KB |
test_05.txt | WA | 22 ms | 796 KB |
test_06.txt | WA | 23 ms | 796 KB |
test_07.txt | WA | 20 ms | 792 KB |
test_08.txt | WA | 19 ms | 792 KB |
test_09.txt | WA | 22 ms | 800 KB |
test_10.txt | WA | 20 ms | 796 KB |
test_11.txt | WA | 22 ms | 800 KB |
test_12.txt | WA | 21 ms | 796 KB |
test_13.txt | WA | 22 ms | 800 KB |
test_14.txt | WA | 23 ms | 800 KB |
test_15.txt | WA | 26 ms | 856 KB |
test_16.txt | WA | 23 ms | 796 KB |
test_17.txt | WA | 21 ms | 800 KB |