제출 #309075

#제출 시각아이디문제언어결과실행 시간메모리
309075DodaUtrka (COCI14_utrka)C++17
80 / 80
345 ms19036 KiB
#include <iostream> #include <string> #include <cmath> #include <algorithm> #include <vector> #include <queue> #include <map> #define pb push_back #define fr(n) for (int i = 0; i<n;i++) typedef long long ll; using namespace std; ll pot (ll q, ll w){ ll qw = 1; for (ll i = 0; i<w; i++) qw*= q; return qw; } ll n; map <string, int> mapa; vector<string> popis; string rj; int main () { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); cin >> n; fr(n*2-1){ string s; cin >> s; mapa[s]+=1; popis.pb(s); } sort (popis.begin(), popis.end()); popis.erase(unique(popis.begin(),popis.end() ), popis.end() ); fr(popis.size()){ if (mapa[popis[i]] % 2 != 0){ rj = popis[i]; cout << rj; return 0; } } return 0; }

컴파일 시 표준 에러 (stderr) 메시지

utrka.cpp: In function 'int main()':
utrka.cpp:10:32: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::__cxx11::basic_string<char> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   10 | #define fr(n) for (int i = 0; i<n;i++)
      |                               ~^~~~~~~
   11 | 
      |                                 
   12 | typedef long long ll;
      | ~~~~~~~~~~~~~~~~~~~~~           
   13 | using namespace std;
      | ~~~~~~~~~~~~~~~~~~~~            
   14 | 
      |                                 
   15 | ll pot (ll q, ll w){
      | ~~~~~~~~~~~~~~~~~~~~            
   16 |  ll qw = 1;
      |  ~~~~~~~~~~                     
   17 |  for (ll i = 0; i<w; i++)
      |  ~~~~~~~~~~~~~~~~~~~~~~~~       
   18 |   qw*= q;
      |   ~~~~~~~                       
   19 |  return qw;
      |  ~~~~~~~~~~                     
   20 | }
      | ~                               
   21 | 
      |                                 
   22 | ll n;
      | ~~~~~                           
   23 | map <string, int> mapa;
      | ~~~~~~~~~~~~~~~~~~~~~~~         
   24 | vector<string> popis;
      | ~~~~~~~~~~~~~~~~~~~~~           
   25 | string rj;
      | ~~~~~~~~~~                      
   26 | 
      |                                 
   27 | int main () {
      | ~~~~~~~~~~~~~                   
   28 | ios::sync_with_stdio(0);
      | ~~~~~~~~~~~~~~~~~~~~~~~~        
   29 | cin.tie(0); cout.tie(0);
      | ~~~~~~~~~~~~~~~~~~~~~~~~        
   30 | 
      |                                 
   31 | cin >> n;
      | ~~~~~~~~~                       
   32 | 
      |                                 
   33 | fr(n*2-1){
      | ~~~~~~~~~~                      
   34 |     string s;
      |     ~~~~~~~~~                   
   35 |     cin >> s;
      |     ~~~~~~~~~                   
   36 |     mapa[s]+=1;
      |     ~~~~~~~~~~~                 
   37 |     popis.pb(s);
      |     ~~~~~~~~~~~~                
   38 | }
      | ~                               
   39 | 
      |                                 
   40 | sort (popis.begin(), popis.end());
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   41 | popis.erase(unique(popis.begin(),popis.end() ), popis.end() );
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   42 | 
      |                                 
   43 | fr(popis.size()){
      | ~~~~~~~~~~~~~~~                 
utrka.cpp:43:1: note: in expansion of macro 'fr'
   43 | fr(popis.size()){
      | ^~
#Verdict Execution timeMemoryGrader output
Fetching results...