Submission #22577

# Submission time Handle Problem Language Result Execution time Memory
22577 2017-04-30T05:41:34 Z wim(#994, wimzzang) Donut-shaped Enclosure (KRIII5_DE) C++
Compilation error
0 ms 0 KB
#include <iostream>
#include <vector>

using namespace std;
typedef struct data {
	int x, y;
	int score;
}Data;


int main()
{
	freopen("input.txt", "r", stdin);
	setbuf(stdout, NULL);
	int N, L, R;
	cin >> N >> L >> R;
	vector<Data> donut;
	for (int i = 0; i < N; i++){
		Data tmp;
		cin >> tmp.x >> tmp.y >> tmp.score;
		if(0 < tmp.score)
			donut.push_back(tmp);
	}
	int sum = 0;
	for (int i = 0; i < donut.size(); i++)
		sum += donut[i].score;
	cout << sum << endl;
	return 0;
}

Compilation message

DE.cpp: In function 'int main()':
DE.cpp:13:28: error: 'stdin' was not declared in this scope
  freopen("input.txt", "r", stdin);
                            ^
DE.cpp:13:33: error: 'freopen' was not declared in this scope
  freopen("input.txt", "r", stdin);
                                 ^
DE.cpp:14:9: error: 'stdout' was not declared in this scope
  setbuf(stdout, NULL);
         ^
DE.cpp:14:21: error: 'setbuf' was not declared in this scope
  setbuf(stdout, NULL);
                     ^
DE.cpp:25:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for (int i = 0; i < donut.size(); i++)
                    ^