P1150 Peter的烟
#include<stdio.h>
int main(){
long int n, k, res;
scanf("%ld%ld", &n, &k);
res = n;
while(n/k){
res += (n / k);
n = n % k + n / k;
}
printf("%ld", res);
return 0;
}
more...P1011 [NOIP1998 提高组] 车站
列表找
#include <stdio.h>
#include <stdlib.h>
int fq(int x, int sorx) //sorx==1 a
{
if (x == 1 || x == 2 || (sorx && x == 4) || (!sorx && x == 3))
return 0;
if ((x == 3 && sor
more...P3375 【模板】KMP字符串匹配
多处用strlen()报TLE😣
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
char s1[1000010], s2[1000010];
scanf("%s", s1);
scanf("%s", s2);
int len1 = strlen(s1);
int len2 = strlen(s2);
int len = len2;
more...