답안 #919130

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
919130 2024-01-31T11:08:15 Z TIN 마라톤 경주 (COCI14_utrka) C++17
80 / 80
70 ms 11304 KB
#include <bits/stdc++.h>

using namespace std;

#define FNAME "test"

const int N = 1e5 + 5;

int n;
string s[N], t[N];

void Task() {
	ios_base::sync_with_stdio(false);
	cin.tie(0); cout.tie(0);
	cout << fixed << setprecision(9);
	if (fopen(FNAME".inp","r")) {
		freopen(FNAME".inp","r",stdin);
		freopen(FNAME".out","w",stdout);
	}
}

void Solve() {
	//Your Code
	cin >> n;
	for (int i = 1; i <= n; i++) {
		cin >> s[i];
	}
	sort(s + 1, s + n + 1);
	for (int i = 1; i < n; i++) {
		cin >> t[i];
	}
	sort(t + 1, t + n);
	t[n] = "";
	for (int i = 1; i <= n; i++) {
		if (s[i] != t[i]) {
			cout << s[i];
			return;
		}
	}
}

int main() {
	Task();
	Solve();
	cerr << "\nTime run: " << 1000*clock()/CLOCKS_PER_SEC << "ms";
	return 37^37;
}

Compilation message

utrka.cpp: In function 'void Task()':
utrka.cpp:17:10: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   17 |   freopen(FNAME".inp","r",stdin);
      |   ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
utrka.cpp:18:10: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   18 |   freopen(FNAME".out","w",stdout);
      |   ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 6692 KB Output is correct
2 Correct 3 ms 6488 KB Output is correct
3 Correct 2 ms 6744 KB Output is correct
4 Correct 3 ms 6744 KB Output is correct
5 Correct 3 ms 6744 KB Output is correct
6 Correct 38 ms 8812 KB Output is correct
7 Correct 52 ms 10064 KB Output is correct
8 Correct 63 ms 10828 KB Output is correct
9 Correct 70 ms 11304 KB Output is correct
10 Correct 68 ms 11092 KB Output is correct