답안 #896034

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
896034 2023-12-31T13:23:54 Z wilsp Lightning Rod (NOI18_lightningrod) C++17
0 / 100
1 ms 728 KB
#include <iostream>
#include <vector>
using namespace std;
//aouxwoux's submission for Mock ZCO#1 Q1

int main()
{
	freopen("lightningrod.in","r",stdin);
	freopen("lightningrod.out","w",stdout);

	vector<pair<int,int>> coords;

	int n;

	cin >> n;

	for(int i = 0; i<n; i++)
	{
		int x,y;
		cin >> x >> y;
		coords.push_back({x,y});
	}

	if(n==1)
	{
		cout << "1" << endl;
	}
	else
	{
		if(coords.size() > 2)
		{
			cout << n;
		}
		else
		{
			cout << "2";
		}
	}

	

	return 0;
}

Compilation message

lightningrod.cpp: In function 'int main()':
lightningrod.cpp:8:9: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
    8 |  freopen("lightningrod.in","r",stdin);
      |  ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lightningrod.cpp:9:9: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
    9 |  freopen("lightningrod.out","w",stdout);
      |  ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 724 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 728 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 728 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 728 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 728 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 724 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 724 KB Output isn't correct
2 Halted 0 ms 0 KB -