Submission #858364

#TimeUsernameProblemLanguageResultExecution timeMemory
858364reginoxBridž (COCI17_bridz)C++17
50 / 50
1 ms600 KiB
#include <bits/stdc++.h> #define ll long long #define faster ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); #define sp << " " #define task "card" using namespace std; ll t; char c; string s; ll sum = 0; int main(){ if(fopen(task".inp","r")){ freopen(task".inp","r",stdin); freopen(task".out","w",stdout); } faster cin >> t; while(t--){ cin >> s; for(ll i = 0; i < s.size(); i++){ c = s[i]; if(c=='A') sum+=4; else if (c=='K') sum+=3; else if (c=='Q') sum+=2; else if (c=='J') sum++; } } cout << sum; return 0; }

Compilation message (stderr)

bridz.cpp: In function 'int main()':
bridz.cpp:20:19: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   20 |   for(ll i = 0; i < s.size(); i++){
      |                 ~~^~~~~~~~~~
bridz.cpp:13:10: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   13 |   freopen(task".inp","r",stdin);
      |   ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
bridz.cpp:14:10: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   14 |   freopen(task".out","w",stdout);
      |   ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...