博文

目前显示的是标签为“jiangly”的博文

【题解】 Dwango Programming Contest 6th

图片
【题解】 Dwango Programming Contest 6th 比赛链接 :  https://atcoder.jp/contests/dwacon6th-prelims A. Falling Asleep 模拟。 # include <iostream> # include <vector> # include <algorithm> # include <numeric> int n; std :: string x; std :: vector < std :: string > s; std :: vector < int > t; int main () { std ::ios::sync_with_stdio( false ); std :: cin .tie( nullptr ); std :: cin >> n; s.resize(n); t.resize(n); for ( int i = 0 ; i < n; ++i) std :: cin >> s[i] >> t[i]; std :: cin >> x; std :: cout << std ::accumulate( std ::find(s.begin(), s.end(), x) - s.begin() + 1 + t.begin(), t.end(), 0 ) << "\n" ; return 0 ; } B. Fusing Slimes # include <iostream> # include <vector> constexpr int P = 1'000'000'007 ; int n; std :: vector < int > x; int power ( int a, int b) { int ans = 1 ; while ...