【Codeforces Round #447 (Div. 2) A】QAQ
【鏈接】 我是鏈接,點我呀:)
【題意】
在這裏輸入題意
【題解】
C語言程序練習題
【代碼】
#include <bits/stdc++.h>
using namespace std;
string s;
int main(){
#ifdef LOCAL_DEFINE
freopen("F:\\c++source\\rush_in.txt", "r", stdin);
#endif
ios::sync_with_stdio(0),cin.tie(0);
cin >> s;
int n = s.size();
int num = 0;
for (int i = 0;i < n;i++)
for (int j = i+1;j < n;j++)
for (int k = j+1;k < n;k++)
if (s[i]=='Q' && s[j]=='A' && s[k]=='Q'){
num++;
}
cout << num << endl;
return 0;
}
【Codeforces Round #447 (Div. 2) A】QAQ
相關推薦
【Codeforces Round #447 (Div. 2) A】QAQ
pro ont 題解 problem fde c語言 span bits endif 【鏈接】 我是鏈接,點我呀:) 【題意】 在這裏輸入題意 【題解】 C語言程序練習題 【代碼】 #include <bits/stdc++.h> using
【Codeforces Round #457 (Div. 2) A】 Jamie and Alarm Snooze
als lar clu efi out .com bit source fin 【鏈接】 我是鏈接,點我呀:) 【題意】 在這裏輸入題意 【題解】 暴力往前走x分鐘就好。 直到出現7為止。 【代碼】 #include <bits/stdc++.h&
【Codeforces Round 332 (Div 2)A】【水題】A. Patrick and Shopping 遍歷三元環的最小成本
Today Patrick waits for a visit from his friend Spongebob. To prepare for the visit, Patrick needs to buy some goodies in two stores located near his hous
【Codeforces Round 333 (Div 2)B】【貪心 多指標】Approximating a Constant Range 給定陣列 相鄰元素波動為1 求差值不超1的最長序連續子序列
When Xellos was doing a practice course in university, he once had to measure the intensity of an effect that slowly approached equilibrium. A good way to
【Codeforces Round #451 (Div. 2) D】Alarm Clock
force alarm cnblogs bit any inpu size class long long 【鏈接】 我是鏈接,點我呀:) 【題意】 在這裏輸入題意 【題解】 尺取法+二分。 類似滑動窗口。 即左端點為l,右端點為r. 維護a[r]-a[l]
【Codeforces Round #456 (Div. 2) C】Perun, Ult!
set != bound names begin pre round 部分 之前 【鏈接】 我是鏈接,點我呀:) 【題意】 在這裏輸入題意 【題解】 set1 < pair < int,int > > set1;記錄關鍵點->某
【Codeforces Round #457 (Div. 2) C】Jamie and Interesting Graph
include pac bits namespace mark span .com ifd graph 【鏈接】 我是鏈接,點我呀:) 【題意】 在這裏輸入題意 【題解】 找比n-1大的最小的素數x 1-2,2-3..(n-2)-(n-1)長度都為1 然後(
【Codeforces Round #239 (Div. 1) A】Triangle
div urn end ont stdin a* 題意 sqrt 是不是 【鏈接】 我是鏈接,點我呀:) 【題意】 在這裏輸入題意 【題解】 最後的直角三角形可以通過平移,將直角頂點移動到坐標原點。 然後我們只要枚舉另外兩個點其中一個點的坐標就好了。 x坐標
【Codeforces Round #462 (Div. 1) A】 A Twisty Movement
syn mark com [1] move blog ont contest 接下來 【鏈接】 我是鏈接,點我呀:) 【題意】 在這裏輸入題意 【題解】 ans初值值為a[1..n]中1的個數。 接下來考慮以2為結尾的最長上升子序列的個數。 枚舉中間點i.
【Codeforces Round #482 (Div. 2) C】Kuro and Walking Route
return lse lac and ios inf == efi div 【鏈接】 我是鏈接,點我呀:) 【題意】 在這裏輸入題意 【題解】 把x..y這條路徑上的點標記一下。 然後從x開始dfs,要求不能走到那些標記過的點上。記錄節點個數為cnt1(包括
【Codeforces Round #493 (Div. 2) B】Cutting
ifd main color ble -a 地方 name 次數 include 【鏈接】 我是鏈接,點我呀:) 【題意】 在這裏輸入題意 【題解】 顯然只有在前i個位置奇數偶數出現次數都相同的地方才能切。 (且不管前面怎麽切,這裏都能切的。 那麽就相當於有
【Codeforces Round 374 (Div 2)C】【DAG上的DP】
C. Journey time limit per test 3 seconds memory limit per test 256 megabytes input standard input output standard output Recently Ir
【Codeforces Round 323 (Div 2)B】【貪心】Robot's Task 最少轉彎次數拿走所有物品
Note In the first sample you can assemble all the pieces of information in the optimal manner by assembling first the piece of information in the first c
【Codeforces Round 332 (Div 2)C】【貪心】Day at the Beach 最多區間數劃分使得區間排序構成全域性排序
One day Squidward, Spongebob and Patrick decided to go to the beach. Unfortunately, the weather was bad, so the friends were unable to ride waves. However
【Codeforces Round 340 (Div 2)E】【莫隊演算法 真實區間思想】XOR and Favorite Number m組區間詢問 問區間中多少連續段異或值為k
E. XOR and Favorite Number time limit per test 4 seconds memory limit per test 256 megabytes input standard input output
【Codeforces Round 336 (Div 2) E】【KMP 構造 腦洞 好題 模擬找規律】Marbles 兩條路徑同時出發前後行走能否恰好同時到終點
In the spirit of the holidays, Saitama has given Genos two grid paths of lengthn(a weird gift even by Saitama's standards). A grid path is an ordered seq
【Codeforces Round 364 (Div 2)E】【樹上路徑 貪心】Connecting Universities 樹上2k個點配對使得路徑之和儘可能大
Treeland is a country in which there arentowns connected byn - 1two-way road such that it's possible to get from any town to any other town. In Treeland
【Codeforces Round 370 (Div 2) E】【線段樹 等比數列 區間合併】Memory and Casinos 賭場區間[l,r] l進r先出的概率
E. Memory and Casinos time limit per test 4 seconds memory limit per test 512 megabytes input standard input output standard o
【Codeforces Round 331 (Div 2)D】【DP 記憶化搜尋 期望DP區間性質 好題】Wilbur and Trees 砍樹隨機從右從左概率左倒右倒的期望底面覆蓋長度
Wilbur and Trees time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard ou
【Codeforces Round 365 (Div 2)D】【離線詢問 樹狀陣列 前驅思想】Mishka and Interesting sum 區間內出現次數偶數的數的異或和
Little Mishka enjoys programming. Since her birthday has just passed, her friends decided to present her with array of non-negative integersa1, a2, ...,