Submission #1195563

#TimeUsernameProblemLanguageResultExecution timeMemory
1195563raphaelpMensza (COI22_mensza)C++20
0 / 100
3435 ms181392 KiB
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int L; cin >> L; // Độ dài tối đa của mảng a và b int Q; cin >> Q; // Số truy vấn for (int q = 0; q < Q; q++) { string type; vector<int> ans; cin >> type; if (type == "alojzije") { int A; cin >> A; if (A == 1000) { for (int i = 0; i < 60; i++) ans.push_back(1); } else { for (int i = 0; i < 30; i++) ans.push_back(2); for (int i = 0; i < 50; i++) ans.push_back(3); for (int i = 0; i < (A % 10); i++) ans.push_back(1); A /= 10; for (int i = 0; i < (A % 10); i++) ans.push_back(2); A /= 10; for (int i = 0; i < (A % 10); i++) ans.push_back(3); } } else if (type == "benjamin") { int A; cin >> A; if (A == 1000) { for (int i = 0; i < 70; i++) ans.push_back(4); } else { for (int i = 0; i < 10; i++) ans.push_back(4); for (int i = 0; i < 20; i++) ans.push_back(5); for (int i = 0; i < 40; i++) ans.push_back(6); for (int i = 0; i < (A % 10); i++) ans.push_back(4); A /= 10; for (int i = 0; i < (A % 10); i++) ans.push_back(5); A /= 10; for (int i = 0; i < (A % 10); i++) ans.push_back(6); } } if (type == "cecilija") { int nb; cin >> nb; vector<int> Tab(nb); for (int i = 0; i < nb; i++) cin >> Tab[i]; int A = 0, B = 0; for (int i = 0; i < nb; i++) { if (Tab[i] < 10) A += Tab[i]; else if (Tab[i] < 20) B += Tab[i] - 10; else if (Tab[i] < 30) B += 10 * (Tab[i] - 20); else if (Tab[i] < 40) A += 10 * (Tab[i] - 30); else if (Tab[i] < 50) B += 100 * (Tab[i] - 40); else if (Tab[i] < 60) A += 100 * (Tab[i] - 50); else if (Tab[i] == 60) A += 1000; else if (Tab[i] == 70) B += 1000; } if (A > B) cout << "A" << '\n'; else cout << "B" << '\n'; } else { cout << ans.size() << ' '; for (int i = 0; i < ans.size() - 1; i++) cout << ans[i] << ' '; cout << ans.back(); cout << '\n'; } } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...