总体来说一般般,大概挺长一段时间没码题了,手生了,难度个人感觉和去年平均难度比要差一些,至少好多都是看一眼就有思路的,手速有点慢,实现能力感觉下降了好多,勉勉强强到最后才过了5道,而且中间并没有太多的思考时间,大部分时间都在敲代码,调代码,不是个好现象,需要反省,反省。
hdu4861 Couple doubi
A.结论题,曾经看过这么个结论,1^k+2^k+3^k+....+(p-1)^k % p (k<p),如果k==p-1,结果为p-1,否则结果为0,证明好像用的原根,大概推一下就是了(我也不是很懂)。
#include <set>
#include <map>
#include <list>
#include <queue>
#include <stack>
#include <cmath>
#include <string>
#include <cstdio>
#include <vector>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
#define PB push_back
#define SIZE(x) (int)x.size()
#define clr(x,y) memset(x,y,sizeof(x))
#define MP(x,y) make_pair(x,y)
#define RS(n) scanf ("%s", n)
#define ALL(t) (t).begin(),(t).end()
#define FOR(i,n,m) for (int i = n; i <= m; i ++)
#define ROF(i,n,m) for (int i = n; i >= m; i --)
#define IT iterator
#define FF first
#define SS second
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef vector<int> vint;
typedef vector<string> vstring;
typedef pair<int, int> PII;
void RI (int& x){
x = 0;
char c = getchar ();
while (!(c>='0' && c<='9' || c=='-')) c = getchar ();
bool flag = 1;
if (c == '-'){
flag = 0;
c = getchar ();
}
while (c >= '0' && c <= '9'){
x = x * 10 + c - '0';
c = getchar ();
}
if (!flag) x = -x;
}
void RII (int& x, int& y){RI (x), RI (y);}
void RIII (int& x, int& y, int& z){RI (x), RI (y), RI (z);}
void RC (char& c){
c = getchar ();
while (c == ' '||c == '\n') c = getchar ();
}
char RC (){
char c = getchar ();
while (c == ' '||c == '\n') c = getchar ();
return c;
}
/**************************************END define***************************************/
const ll mod = 1e9+7;
const ll LINF = 1e18;
const int INF = 1e9;
const double EPS = 1e-8;
int main (){
ll k, p;
while (cin >> k >> p){
ll num = (k/(p-1));
if (num&1){
puts ("YES");
}else{
puts ("NO");
}
}
}