/ Vijos /

记录详情

Compile Error

foo.cpp:1:1: error: 'include' does not name a type
 include <cstdio>
 ^
foo.cpp: In function 'int main()':
foo.cpp:11:21: error: 'scanf' was not declared in this scope
 scanf("%d%d", &l, &w); scanf("%d", &n); for (int i = 0; i < n; i++) scanf("%d%d", &s[i].x, &s[i].y); s[n++] = (node){0, 0}; s[n++] = (node){w, 0}; s[n++] = (node){0, l}; s[n++] = (node){w, l}; sort(s, s + n); int left, right, up, down; int ans = 0; for (int i = 0; i < n; i++){ left = s[i].x; up = 0; down = s[i].y; for (int j = i + 1; j < n; j++){ if (s[j].x == left) continue; right = s[j].x; int ss = abs((right - left) * (down - up)); ans = max(ans, ss); if (s[j].y < down && s[j].y >= s[i].y){down = s[j].y;} if (s[j].y > up && s[j].y <= s[i].y){up = s[j].y;} if (up >= down) break; } } printf("%d\n", ans); return 0; }
                     ^
foo.cpp:11:207: error: 'sort' was not declared in this scope
 scanf("%d%d", &l, &w); scanf("%d", &n); for (int i = 0; i < n; i++) scanf("%d%d", &s[i].x, &s[i].y); s[n++] = (node){0, 0}; s[n++] = (node){w, 0}; s[n++] = (node){0, l}; s[n++] = (node){w, l}; sort(s, s + n); int left, right, up, down; int ans = 0; for (int i = 0; i < n; i++){ left = s[i].x; up = 0; down = s[i].y; for (int j = i + 1; j < n; j++){ if (s[j].x == left) continue; right = s[j].x; int ss = abs((right - left) * (down - up)); ans = max(ans, ss); if (s[j].y < down && s[j].y >= s[i].y){down = s[j].y;} if (s[j].y > up && s[j].y <= s[i].y){up = s[j].y;} if (up >= down) break; } } printf("%d\n", ans); return 0; }
                                                                                                                                                                                                               ^
foo.cpp:11:437: error: 'abs' was not declared in this scope
 scanf("%d%d", &l, &w); scanf("%d", &n); for (int i = 0; i < n; i++) scanf("%d%d", &s[i].x, &s[i].y); s[n++] = (node){0, 0}; s[n++] = (node){w, 0}; s[n++] = (node){0, l}; s[n++] = (node){w, l}; sort(s, s + n); int left, right, up, down; int ans = 0; for (int i = 0; i < n; i++){ left = s[i].x; up = 0; down = s[i].y; for (int j = i + 1; j < n; j++){ if (s[j].x == left) continue; right = s[j].x; int ss = abs((right - left) * (down - up)); ans = max(ans, ss); if (s[j].y < down && s[j].y >= s[i].y){down = s[j].y;} if (s[j].y > up && s[j].y <= s[i].y){up = s[j].y;} if (up >= down) break; } } printf("%d\n", ans); return 0; }
                                                                                                                                                                                                                                                                                                                                                                                                                                                     ^
foo.cpp:11:457: error: 'max' was not declared in this scope
 scanf("%d%d", &l, &w); scanf("%d", &n); for (int i = 0; i < n; i++) scanf("%d%d", &s[i].x, &s[i].y); s[n++] = (node){0, 0}; s[n++] = (node){w, 0}; s[n++] = (node){0, l}; s[n++] = (node){w, l}; sort(s, s + n); int left, right, up, down; int ans = 0; for (int i = 0; i < n; i++){ left = s[i].x; up = 0; down = s[i].y; for (int j = i + 1; j < n; j++){ if (s[j].x == left) continue; right = s[j].x; int ss = abs((right - left) * (down - up)); ans = max(ans, ss); if (s[j].y < down && s[j].y >= s[i].y){down = s[j].y;} if (s[j].y > up && s[j].y <= s[i].y){up = s[j].y;} if (up >= down) break; } } printf("%d\n", ans); return 0; }
                                                                                                                                                                                                                                                                                                                                                                                                                                                                         ^
foo.cpp:11:611: error: 'printf' was not declared in this scope
 scanf("%d%d", &l, &w); scanf("%d

信息

递交者
类型
递交
题目
P1055 奶牛浴场
语言
C++
递交时间
2014-01-28 19:20:57
评测时间
2014-01-28 19:20:59
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes