Submission #63166

# Submission time Handle Problem Language Result Execution time Memory
63166 2018-08-01T01:47:05 Z kjp4155 None (KOI18_box) C++17
Compilation error
0 ms 0 KB
#include <stdio.h>
#include <algorithm>

int main(){
	int px1, py1, px2, py2;
	int qx1, qy1, qx2, qy2;
	scanf("%d%d%d%d",&px1,&py1,&px2,&py2);
	scanf("%d%d%d%d",&qx1,&qy1,&qx2,&qy2);

	int x_left = max(px1, qx1);
	int x_right = min(px2, qx2);
	int y_bottom = max(py1, qy1);
	int y_top = min(py2, qy2);

	int xdiff = x_right - x_left;
	int ydiff = y_top - y_bottom;

	if( xdiff > 0 && ydiff > 0 ) printf("FACE\n");
	else if( xdiff == 0 && ydiff > 0 ) printf("LINE\n");
	else if( xdiff > 0 && ydiff == 0 ) printf("LINE\n");
	else if( xdiff == 0 && ydiff == 0 ) printf("POINT\n");
	else printf("NULL\n");
}

Compilation message

box.cpp: In function 'int main()':
box.cpp:10:15: error: 'max' was not declared in this scope
  int x_left = max(px1, qx1);
               ^~~
box.cpp:10:15: note: suggested alternative:
In file included from /usr/include/c++/7/algorithm:62:0,
                 from box.cpp:2:
/usr/include/c++/7/bits/stl_algo.h:3468:5: note:   'std::max'
     max(initializer_list<_Tp> __l, _Compare __comp)
     ^~~
box.cpp:11:16: error: 'min' was not declared in this scope
  int x_right = min(px2, qx2);
                ^~~
box.cpp:11:16: note: suggested alternative:
In file included from /usr/include/c++/7/algorithm:62:0,
                 from box.cpp:2:
/usr/include/c++/7/bits/stl_algo.h:3456:5: note:   'std::min'
     min(initializer_list<_Tp> __l, _Compare __comp)
     ^~~
box.cpp:7:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d%d%d%d",&px1,&py1,&px2,&py2);
  ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
box.cpp:8:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d%d%d%d",&qx1,&qy1,&qx2,&qy2);
  ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~