結果
| 問題 |
No.1367 文字列門松
|
| コンテスト | |
| ユーザー |
tada721
|
| 提出日時 | 2021-01-29 21:21:48 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 4,678 bytes |
| コンパイル時間 | 881 ms |
| コンパイル使用メモリ | 87,336 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-27 07:27:29 |
| 合計ジャッジ時間 | 1,684 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 15 WA * 12 |
コンパイルメッセージ
main.cpp: In function 'long long int keta(long long int)':
main.cpp:37:1: warning: control reaches end of non-void function [-Wreturn-type]
37 | }
| ^
main.cpp: In function 'long long int gcd(long long int, long long int)':
main.cpp:51:1: warning: control reaches end of non-void function [-Wreturn-type]
51 | }
| ^
main.cpp: In function 'long long int lcm(long long int, long long int)':
main.cpp:64:1: warning: control reaches end of non-void function [-Wreturn-type]
64 | }
| ^
ソースコード
#include<iostream>
#include<algorithm>
#include<cmath>
#include<map>
#include<stdio.h>
#include<vector>
#include<queue>
#include<math.h>
#include<deque>
using namespace std;
#define int long long
#define rep(s,i,n) for(int i=s;i<n;i++)
#define c(n) cout<<n<<endl;
#define ic(n) int n;cin>>n;
#define sc(s) string s;cin>>s;
#define mod 998244353
#define inf 1000000000000000007
#define f first
#define s second
#define mini(c,a,b) *min_element(c+a,c+b)
#define maxi(c,a,b) *max_element(c+a,c+b)
#define pi 3.141592653589793238462643383279
#define e_ 2.718281828459045235360287471352
#define P pair<int,int>
#define upp(a,n,x) upper_bound(a,a+n,x)-a;
#define low(a,n,x) lower_bound(a,a+n,x)-a;
#define UF UnionFind
#define pb push_back
//printf("%.12Lf\n",);
int keta(int x) {
rep(0, i, 30) {
if (x < 10) {
return i + 1;
}
x = x / 10;
}
}
int gcd(int x, int y) {
if (x == 0 || y == 0)return x + y;
int aa = x, bb = y;
rep(0, i, 1000) {
aa = aa % bb;
if (aa == 0) {
return bb;
}
bb = bb % aa;
if (bb == 0) {
return aa;
}
}
}
int lcm(int x, int y) {
int aa = x, bb = y;
rep(0, i, 1000) {
aa = aa % bb;
if (aa == 0) {
return x / bb * y;
}
bb = bb % aa;
if (bb == 0) {
return x / aa * y;
}
}
}
bool prime(int x) {
if (x == 1)return false;
rep(2, i, sqrt(x) + 1) {
if (x % i == 0 && x != i) {
return false;
}
}
return true;
}
int max(int a, int b) {
if (a >= b)return a;
else return b;
}
string maxst(string s, string t) {
int n = s.size();
int m = t.size();
if (n > m)return s;
else if (n < m)return t;
else {
rep(0, i, n) {
if (s[i] > t[i])return s;
if (s[i] < t[i])return t;
}
return s;
}
}
int min(int a, int b) {
if (a >= b)return b;
else return a;
}
int yakuwa(int n) {
int sum = 0;
rep(1, i, sqrt(n + 1)) {
if (n % i == 0)sum += i + n / i;
if (i * i == n)sum -= i;
}
return sum;
}
int poow(int n,int m){
int pro=1;
int nn=n;
while(m){
if(m%2==1)pro=pro*nn%mod;
m=m/2;
nn=nn*nn%mod;
}
return pro;
}
int poow2(int n,int m,int modulo){
int pro=1;
int nn=n;
while(m){
if(m%2==1)pro=pro*nn%modulo;
m=m/2;
nn=nn*nn%modulo;
}
return pro;
}
int inv(int n,int m){
int t=poow(m,mod-2)%mod;
return n*t%mod;
}
int com(int n,int m){
if(n<m)return 0;
int bunsi=1,bunbo=1;
for(int i=n-m+1;i<=n;i++)bunsi=bunsi*i%mod;
for(int i=1;i<=m;i++)bunbo=bunbo*i%mod;
return inv(bunsi,bunbo);
}
int minpow(int x, int y) {
int sum = 1;
rep(0, i, y)sum *= x;
return sum;
}
int ketawa(int x, int sinsuu) {
int sum = 0;
rep(0, i, 100)sum += (x % poow(sinsuu, i + 1)) / (poow(sinsuu, i));
return sum;
}
int sankaku(int a) {
return a * (a + 1) / 2;
}
int sames(int a[1111111], int n) {
int ans = 0;
rep(0, i, n) {
if (a[i] == a[i + 1]) {
int j = i;
while (a[j + 1] == a[i] && j <= n - 2)j++;
ans += sankaku(j - i);
i = j;
}
}
return ans;
}
using Graph = vector<vector<int>>;
int oya[114514];
int depth[114514];
void dfs(const Graph& G, int v, int p, int d) {
depth[v] = d;
oya[v] = p;
for (auto nv : G[v]) {
if (nv == p) continue; // nv が親 p だったらダメ
dfs(G, nv, v, d + 1); // d を 1 増やして子ノードへ
}
}
/*int H=10,W=10;
char field[10][10];
char memo[10][10];
void dfs(int h, int w) {
memo[h][w] = 'x';
// 八方向を探索
for (int dh = -1; dh <= 1; ++dh) {
for (int dw = -1; dw <= 1; ++dw) {
if(abs(0-dh)+abs(0-dw)==2)continue;
int nh = h + dh, nw = w + dw;
// 場外アウトしたり、0 だったりはスルー
if (nh < 0 || nh >= H || nw < 0 || nw >= W) continue;
if (memo[nh][nw] == 'x') continue;
// 再帰的に探索
dfs(nh, nw);
}
}
}*/
struct UnionFind {
vector<int> par; // par[i]:iの親の番号 (例) par[3] = 2 : 3の親が2
UnionFind(int N) : par(N) { //最初は全てが根であるとして初期化
for (int i = 0; i < N; i++) par[i] = i;
}
int root(int x) { // データxが属する木の根を再帰で得る:root(x) = {xの木の根}
if (par[x] == x) return x;
return par[x] = root(par[x]);
}
void unite(int x, int y) { // xとyの木を併合
int rx = root(x); //xの根をrx
int ry = root(y); //yの根をry
if (rx == ry) return; //xとyの根が同じ(=同じ木にある)時はそのまま
par[rx] = ry; //xとyの根が同じでない(=同じ木にない)時:xの根rxをyの根ryにつける
}
bool same(int x, int y) { // 2つのデータx, yが属する木が同じならtrueを返す
int rx = root(x);
int ry = root(y);
return rx == ry;
}
};
signed main(){
sc(s)
string p="kadomatsu";
rep(0,i,9){
string t;
rep(0,j,9){
if(i!=j)t+=p[j];
}
if(t==s||s==p){
c("Yes")
return 0;
}
}
c("No")
}
tada721