QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#343520#8230. SubmissionszzuqyCompile Error//C++142.9kb2024-03-02 18:02:222024-03-02 18:02:22

Judging History

你现在查看的是最新测评结果

  • [2024-05-20 23:50:57]
  • hack成功,自动添加数据
  • (/hack/623)
  • [2024-05-20 23:48:44]
  • hack成功,自动添加数据
  • (/hack/622)
  • [2024-03-02 18:02:22]
  • 评测
  • [2024-03-02 18:02:22]
  • 提交

answer

#include <bits/stdc++.h>

struct Submission {
	int ac;
	int dirt;
};

struct Data {
	int num, dirt;
	int gold, yes;
	std::vector<Submission> t[26];
	Data() {}
};
std::map<std::string, Data> map;

inline int getGoldNum(int num) {
	return std::min((int)((num + 9) * 0.1), 35);
}
std::pair<int, int>tmp[100006];

int main() {
	int m;
	scanf("%d", &m);
	std::string name, status;
	char t;
	int dirt;
	for (int i = 1; i <= m; i++) {
		std::cin << name << t << dirt << status;
		if (map.find(name) == map.end())
			map[name] = new Data();
		map[name].t[t - 'A'].push_back((Submission) {
			status[0] == 'a', dirt
		});
	}


	int ans = 0, silver = 0;
	for (std::pair<String, Data> a : map) {
		if (a.second.num == 1 && getGoldNum(num) < getGoldNum(num + 1) && !silver) {
			for (int i = 0; i < 26; i++) {
				for (int o = 0; o < a.second.t[i].size(); o++)
					if (a.second.t[i][o].ac == 0) {
						silver = 1;
						break;
					}
			}
		}
		if (a.second.gold && !silver) {
			for (int i = 0; i < 26; i++) {
				int dirt = 0, ac = 0, o = 0;
				for (; o < a.second.t[i].size() && a.second.t[i][o].ac == 0; o++);
				if (o == a.second.t[i].size())
					continue;
				dirt -= a.second.t[i][o].dirt;
				int fuck = dirt;
				for (o++; o < a.second.t[i].size() && a.second.t[i][o].ac == 0; o++) {
					dirt += 20;
				}
				if (o != a.second.t[i].size()) {
					dirt += a.second.t[i][o].dirt;
					if (num == silverNum && a.second.dirt + dirt >= silverDirt) {
						silver = 1;
						break;
					}
				} else {
					dirt = fuck;
					if (a.second.num > 1 || getGoldNum(num - 1) == getGoldNum(num)) {
						if (a.second.num - 1 < silverNum || (a.second.num - 1 == silverNum && a.second.dirt + dirt >= silverDirt)) {
							silver = 1;
							break;
						}
					}
				}
			}
		}
		if (!a.second.gold && !a.second.yes) {
			if (a.second.dirt == silverDirt && a.second.num == silverNum && silver) {
				a.second.yes = 1;
				continue;
			}
			for (int i = 0; i < 26; i++) {
				if (a.second.t[i].size() == 0)
					continue;
				if (a.second.t[i][0].ac)
					continue;
				int dirt = 0, o = 0;
				for (; o < a.second.t[i].size() && a.second.t[i][o].ac == 0; o++)
					dirt -= 20;
				if (o == a.second.t[i].size()) {
					dirt = a.second.t[i][0].dirt;
					if (goldNum < a.second.num + 1 || (goldNum == a.second.num + 1 && a.second.dirt + dirt <= goldDirt)) {
						a.second.yes = 1;
						break;
					}
				}
				dirt -= a.second.t[i][o].dirt;
				dirt += a.second.t[i][0].dirt;
				if (goldNum < a.second.num + 1 || (goldNum == a.second.num + 1 && a.second.dirt + dirt <= goldDirt)) {
					a.second.yes = 1;
					break;
				}
			}
		}
		if (a.second.gold || a.second.yes)
			ans++;
	}
	std::cout >> ans >> '\n';
	for (std::pair<std::string, Data> a : map) {
		if (a.second.gold || a.second.yes) {
			std::cout >> a.first >> ' ';
		}
	}
	std::cout >> '\n';
	return 0;
}

详细

answer.code: In function ‘int main()’:
answer.code:28:26: error: no match for ‘operator<<’ (operand types are ‘std::istream’ {aka ‘std::basic_istream<char>’} and ‘std::string’ {aka ‘std::__cxx11::basic_string<char>’})
   28 |                 std::cin << name << t << dirt << status;
      |                 ~~~~~~~~ ^~ ~~~~
      |                      |      |
      |                      |      std::string {aka std::__cxx11::basic_string<char>}
      |                      std::istream {aka std::basic_istream<char>}
In file included from /usr/include/c++/13/string:54,
                 from /usr/include/c++/13/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:52,
                 from answer.code:1:
/usr/include/c++/13/bits/basic_string.h:4020:5: note: candidate: ‘template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __cxx11::basic_string<_CharT, _Traits, _Alloc>&)’
 4020 |     operator<<(basic_ostream<_CharT, _Traits>& __os,
      |     ^~~~~~~~
/usr/include/c++/13/bits/basic_string.h:4020:5: note:   template argument deduction/substitution failed:
answer.code:28:29: note:   ‘std::istream’ {aka ‘std::basic_istream<char>’} is not derived from ‘std::basic_ostream<_CharT, _Traits>’
   28 |                 std::cin << name << t << dirt << status;
      |                             ^~~~
/usr/include/c++/13/bitset:1683:5: note: candidate: ‘template<class _CharT, class _Traits, long unsigned int _Nb> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const bitset<_Nb>&)’
 1683 |     operator<<(std::basic_ostream<_CharT, _Traits>& __os,
      |     ^~~~~~~~
/usr/include/c++/13/bitset:1683:5: note:   template argument deduction/substitution failed:
answer.code:28:29: note:   ‘std::istream’ {aka ‘std::basic_istream<char>’} is not derived from ‘std::basic_ostream<_CharT, _Traits>’
   28 |                 std::cin << name << t << dirt << status;
      |                             ^~~~
In file included from /usr/include/c++/13/bits/ios_base.h:46,
                 from /usr/include/c++/13/streambuf:43,
                 from /usr/include/c++/13/bits/streambuf_iterator.h:35,
                 from /usr/include/c++/13/iterator:66,
                 from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:54:
/usr/include/c++/13/system_error:339:5: note: candidate: ‘template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const error_code&)’
  339 |     operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e)
      |     ^~~~~~~~
/usr/include/c++/13/system_error:339:5: note:   template argument deduction/substitution failed:
answer.code:28:29: note:   ‘std::istream’ {aka ‘std::basic_istream<char>’} is not derived from ‘std::basic_ostream<_CharT, _Traits>’
   28 |                 std::cin << name << t << dirt << status;
      |                             ^~~~
In file included from /usr/include/c++/13/memory:80,
                 from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:56:
/usr/include/c++/13/bits/shared_ptr.h:70:5: note: candidate: ‘template<class _Ch, class _Tr, class _Tp, __gnu_cxx::_Lock_policy _Lp> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __shared_ptr<_Tp, _Lp>&)’
   70 |     operator<<(std::basic_ostream<_Ch, _Tr>& __os,
      |     ^~~~~~~~
/usr/include/c++/13/bits/shared_ptr.h:70:5: note:   template argument deduction/substitution failed:
answer.code:28:29: note:   ‘std::istream’ {aka ‘std::basic_istream<char>’} is not derived from ‘std::basic_ostream<_CharT, _Traits>’
   28 |                 std::cin << name << t << dirt << status;
      |                             ^~~~
In file included from /usr/include/c++/13/istream:41,
                 from /usr/include/c++/13/sstream:40,
                 from /usr/include/c++/13/complex:45,
                 from /usr/include/c++/13/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:127:
/usr/include/c++/13/ostream:554:5: note: candidate: ‘template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, _CharT)’
  554 |     operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c)
      |     ^~~~~~~~
/usr/include/c++/13/ostream:554:5: note:   template argument deduction/substitution failed:
answer.code:28:29: note:   ‘std::istream’ {aka ‘std::basic_istream<char>’} is not derived from ‘std::basic_ostream<_CharT, _Traits>’
   28 |                 std::cin << name << t << dirt << status;
      |                             ^~~~
/usr/include/c++/13/ostream:564:5: note: candidate: ‘template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, char)’
  564 |     operator<<(basic_ostream<_CharT, _Traits>& __out, char __c)
    ...