Submission #300075

# Submission time Handle Problem Language Result Execution time Memory
300075 2020-09-16T12:40:05 Z theshadow_04 Utrka (COCI14_utrka) C++14
80 / 80
240 ms 14712 KB
// VU TRUONG AN
#include <bits/stdc++.h>
#define F first
#define S second
#define MOD 1000000007
#define pb push_back
#define bit(x,p) ((x>>p) & 1)
#define ll long long
#define Task "UTRKA"
using namespace std;

const int base = 100003;
const int maxn = 100005;

string s[maxn];
int n;
map<string,int> M;

int main(){
    ios_base::sync_with_stdio(0);
    cout.tie(0); cin.tie(0);
	if(fopen(Task".inp","r")){
		freopen(Task".inp","r",stdin);
		freopen(Task".out","w",stdout);
	}
    cin >> n;
    for(int i = 1;i <= n;++i) cin >> s[i];
    for(int i = 1;i < n;++i){
        string a;
        cin >> a;
        M[a] ++;
    }
    for(int i = 1;i <= n;++i){
        if(!M[s[i]]){
            cout << s[i];
            return 0;
        }
        M[s[i]]--;
    }
}

Compilation message

utrka.cpp: In function 'int main()':
utrka.cpp:23:10: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result]
   23 |   freopen(Task".inp","r",stdin);
      |   ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
utrka.cpp:24:10: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result]
   24 |   freopen(Task".out","w",stdout);
      |   ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 3 ms 3456 KB Output is correct
2 Correct 3 ms 3456 KB Output is correct
3 Correct 3 ms 3456 KB Output is correct
4 Correct 4 ms 3528 KB Output is correct
5 Correct 3 ms 3584 KB Output is correct
6 Correct 71 ms 9184 KB Output is correct
7 Correct 138 ms 11896 KB Output is correct
8 Correct 171 ms 13768 KB Output is correct
9 Correct 139 ms 14712 KB Output is correct
10 Correct 240 ms 14712 KB Output is correct