답안 #81633

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
81633 2018-10-25T16:16:04 Z xiaowuc1 마라톤 경주 (COCI14_utrka) C++14
80 / 80
271 ms 25732 KB
#include <bits/stdc++.h>

/*
unsigned seed1 = std::chrono::system_clock::now().time_since_epoch().count();
mt19937 g1.seed(seed1);

ios_base::sync_with_stdio(false);
cin.tie(NULL);
*/
using namespace std;

const double PI = 2 * acos(0);

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<int, ll> pill;
typedef pair<ll, ll> pll;
typedef long double ld;
typedef vector<vector<ll>> matrix;

map<string, int> dp1;
map<string, int> dp2;

char buf[25];
void load(map<string, int>& dp, int n) {
  while(n--) {
    scanf("%s", buf);
    dp[string(buf)]++;
  }
}

int main() {
  int n;
  scanf("%d", &n);
  load(dp1, n);
  load(dp2, n-1);
  for(auto x: dp1) {
    if(dp2[x.first] != x.second) {
      cout << x.first << endl;
      return 0;
    }
  }
}

Compilation message

utrka.cpp: In function 'void load(std::map<std::__cxx11::basic_string<char>, int>&, int)':
utrka.cpp:28:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%s", buf);
     ~~~~~^~~~~~~~~~~
utrka.cpp: In function 'int main()':
utrka.cpp:35:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d", &n);
   ~~~~~^~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 384 KB Output is correct
3 Correct 3 ms 560 KB Output is correct
4 Correct 3 ms 648 KB Output is correct
5 Correct 3 ms 764 KB Output is correct
6 Correct 111 ms 9640 KB Output is correct
7 Correct 191 ms 15132 KB Output is correct
8 Correct 250 ms 19748 KB Output is correct
9 Correct 271 ms 23396 KB Output is correct
10 Correct 255 ms 25732 KB Output is correct