传送门 解题思路 一道%你神题,\(string\)好强大啊..首先枚举一个周几,再枚举一个罪犯是谁,然后判断的时候就是枚举所有人说的话.定义\(fAKe[i]\)表示第\(i\)个人说的是真话还是假话还是未知.然后如果遇到\(xx is guilty\)或\(I am guilty\)之类的话,就看枚举的罪犯是否为这个人.如果说的是\(Today is xxx\),就看当前枚举的星期是否为这一天. 代码 #include<iostream> #include<cstdio> #i…
/* 枚举罪犯和星期几,那么所有人说的话是真是假一目了然. 首先一个人不能既说真话又说假话. 即: I am guilty. I am not guilty. 因为非真即假,所以直接判断impossible. map<string,int>表示名字对应的id name[i]表示id为i的人对应的人名. kp[i][j]表示第i个人认为第j个人是不是罪犯.0/-1/1,表示不是,没说,是 kd[i][j]表示第i个人认为今天是星期j么?0/-1/1表示 不认为.没说.认为 impossible的…
#include<cstdio> #include<cstring> #include<string> #include<iostream> using namespace std; string s[1005]; int fake[1005]; string name[1005]; string day[10]={"23333333","Today is Monday.","Today is Tuesday…
题目链接:http://codeforces.com/contest/832/problem/B B. Petya and Exam time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output It's hard times now. Today Petya needs to score 100 points on Informatics…
The digital root of a positive integer is found by summing the digits of the integer. If the resulting value is a single digit then that digit is the digital root. If the resulting value contains two or more digits, those digits are summed and the pr…
题目链接:https://codeforces.com/contest/1090/problem/B Examplesstandard input The most famous characters of Pushkin’s works are Onegin \cite{onegin}, Dubrovsky \cite{dubrovsky} and Tsar Saltan \cite{saltan}. \begin{thebibliography}{99} \bibitem{saltan} A…
Hierarchical Notation Time Limit: 2 Seconds Memory Limit: 131072 KB In Marjar University, students in College of Computer Science will learn EON (Edward Object Notation), which is a hierarchical data format that uses human-readable text to trans…