problemscpp
A collection of my answers to algorithm problems in c++.
静态 Public 成员函数 | 所有成员列表
luogu::P1603类 参考

洛谷 P1603 斯诺登的密码 更多...

#include <luogu.h>

静态 Public 成员函数

static int main (istream &cin, ostream &cout)
 

详细描述

洛谷 P1603 斯诺登的密码

在文件 luogu.h567 行定义.

成员函数说明

◆ main()

int luogu::P1603::main ( istream &  cin,
ostream &  cout 
)
static

在文件 luogu.cpp2111 行定义.

2111 {
2112 unordered_map<string, int> um;
2113 um["one"] = 1;
2114 um["two"] = 2;
2115 um["three"] = 3;
2116 um["four"] = 4;
2117 um["five"] = 5;
2118 um["six"] = 6;
2119 um["seven"] = 7;
2120 um["eight"] = 8;
2121 um["nine"] = 9;
2122 um["ten"] = 10;
2123 um["eleven"] = 11;
2124 um["twelve"] = 12;
2125 um["thirteen"] = 13;
2126 um["fourteen"] = 14;
2127 um["fifteen"] = 15;
2128 um["sixteen"] = 16;
2129 um["seventeen"] = 17;
2130 um["eighteen"] = 18;
2131 um["nineteen"] = 19;
2132 um["twenty"] = 20;
2133 um["a"] = 1;
2134 um["both"] = 2;
2135 um["another"] = 1;
2136 um["first"] = 1;
2137 um["second"] = 2;
2138 um["third"] = 3;
2139 multiset<int> ms;
2140 string word;
2141 for(int i = 0; i < 6; i++) {
2142 cin >> word;
2143 if(um.contains(word)) {
2144 ms.insert(um[word] * um[word] % 100);
2145 }
2146 }
2147 if(ms.empty()) {
2148 cout << 0;
2149 return 0;
2150 }
2151 stringstream ss;
2152 for(const auto i: ms) {
2153 if(i < 10) {
2154 ss << '0';
2155 }
2156 ss << i;
2157 }
2158 unsigned long long ans;
2159 ss >> ans;
2160 cout << ans;
2161 return 0;
2162 }
void ms(vector< int > &arr, int l, int r, int *ans)
Definition: acwing.cpp:6334

引用了 acwing::acwing788::ms().

被这些函数引用 luogu::TEST().


该类的文档由以下文件生成: