Submission #1101641

#TimeUsernameProblemLanguageResultExecution timeMemory
1101641vjudge1Bridž (COCI17_bridz)C++17
50 / 50
2 ms476 KiB
#include <bits/stdc++.h> #define task "TEST" #define task2 "A" #define pl pair<int, int> #define pf push_front #define pb push_back #define pob pop_back #define pof pop_front #define mp make_pair #define fi first #define se second #define FOR(i, a, b, c) for (int i=a; i<=b; i+=c) #define FORE(i, a, b, c) for (int i=a; i>=b; i+=c) using namespace std; using ll = long long; using ull = unsigned long long; const int Mod = 1e9+7; const int maxn = 1e7; const ll Inf = 1e18; string str; ll res, t; void Read() { cin >> t; while (t--){ cin >> str; FOR(i, 0, str.length()-1, 1) { if (str[i] == 'A') res += 4; else if (str[i] == 'K') res += 3; else if (str[i] == 'Q') res += 2; else if (str[i] == 'J') res++; } } cout << res; } void Solve() { } int main() { if (fopen (task".inp", "r")) { freopen (task".inp", "r", stdin); freopen (task".out", "w", stdout); } ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int t; for (t=1; t--;) { Read(); Solve(); } }

Compilation message (stderr)

bridz.cpp: In function 'void Read()':
bridz.cpp:12:40: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   12 | #define FOR(i, a, b, c) for (int i=a; i<=b; i+=c)
......
   26 |         FOR(i, 0, str.length()-1, 1) {
      |             ~~~~~~~~~~~~~~~~~~~~        
bridz.cpp:26:9: note: in expansion of macro 'FOR'
   26 |         FOR(i, 0, str.length()-1, 1) {
      |         ^~~
bridz.cpp: In function 'int main()':
bridz.cpp:42:17: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   42 |         freopen (task".inp", "r", stdin);
      |         ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
bridz.cpp:43:17: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   43 |         freopen (task".out", "w", stdout);
      |         ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...