# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
1101804 |
2024-10-16T20:32:35 Z |
bvv23 |
Marko (COCI15_marko) |
C++17 |
|
5 ms |
1616 KB |
// Ahmadov orz
/// successful failure
#include <bits/stdc++.h>
/// #include <ext/pb_ds/assoc_container.hpp>
using namespace std;
/// using namespace __gnu_pbds;
#define int long long
#define pb push_back
#define pii pair<int, int>
#define all(v) v.begin(),v.end()
#define ff first
#define ss second
#define drop(x) cout<<x<<endl;return
// template <class T>
// using isTree = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
/// sometimes you gotta think simple
struct custom_hash {
size_t operator()(uint64_t x) const {
static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
x ^= FIXED_RANDOM;
return x ^ (x >> 16);
}
};
string ch[27] = {
"2", "2", "2 ",
"3", "3", "3",
"4", "4", "4",
"5", "5", "5",
"6", "6", "6",
"7", "7", "7", "7",
"8", "8", "8",
"9", "9", "9", "9"
};
string convert(string s)
{
string ans = "";
for (int i = 0; i < s.size(); i++) {
//char c = s[i];
//cout << c << endl;
ans += ch[s[i] - 'a'];
}
return ans;
}
void failure()
{
int n;
cin >> n;
unordered_map <string,int> mp;
vector <string> arr(n);
for (int i = 0; i < n; i++) {
cin >> arr[i];
string tmp = convert(arr[i]);
mp[tmp]++;
}
string s;
cin >> s;
int ans = 0;
drop(mp[s]);
}
signed main() {
ios_base::sync_with_stdio(0);
cin.tie(NULL);
cout.tie(NULL);
int tt = 1;
//cin >> tt;
while (tt--)
{
failure();
}
}
Compilation message
marko.cpp: In function 'std::string convert(std::string)':
marko.cpp:38:23: 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]
38 | for (int i = 0; i < s.size(); i++) {
| ~~^~~~~~~~~~
marko.cpp: In function 'void failure()':
marko.cpp:58:9: warning: unused variable 'ans' [-Wunused-variable]
58 | int ans = 0;
| ^~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
336 KB |
Output is correct |
2 |
Incorrect |
1 ms |
336 KB |
Output isn't correct |
3 |
Correct |
1 ms |
336 KB |
Output is correct |
4 |
Incorrect |
4 ms |
1360 KB |
Output isn't correct |
5 |
Incorrect |
2 ms |
592 KB |
Output isn't correct |
6 |
Incorrect |
1 ms |
592 KB |
Output isn't correct |
7 |
Incorrect |
3 ms |
1104 KB |
Output isn't correct |
8 |
Incorrect |
5 ms |
1616 KB |
Output isn't correct |
9 |
Incorrect |
1 ms |
592 KB |
Output isn't correct |
10 |
Incorrect |
3 ms |
1272 KB |
Output isn't correct |