Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
请问为什么WA#include <iostream> #include <sstream> #include <string> #include <vector> #include <set> #include <map> #include <algorithm> #include <cstdio> #include <cstdlib> #include <cmath> #include <math.h> #include <string.h> #include <stdlib.h> using namespace std; #define REP(i, n) for(int i = 0; i<(n); i++) #define abs(a) ((a) >= 0 ? (a) : -(a)) #define inf 999999999 typedef vector<int> VI; typedef vector<string> VS; typedef long long i64; typedef unsigned long long u64; int n, nc; char buf[1<<25]; bool v[1<<25]; int main() { cin>>n>>nc; scanf("%s", buf); long long res = 0; for (int i = 0; buf[i+n-1] != '\0'; i++) { int t = 0; for (int j = i; j < i+n; j++) t = t*nc + buf[j] - 'a'; if (v[t] == 0) {v[t] = 1; res++; } } printf("%I64d", res); } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator