結果

問題 No.889 素数!
ユーザー pekempeypekempey
提出日時 2019-09-26 03:31:41
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 4,529 bytes
コンパイル時間 775 ms
コンパイル使用メモリ 80,344 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-24 14:08:10
合計ジャッジ時間 2,608 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 WA -
testcase_05 AC 2 ms
4,348 KB
testcase_06 AC 2 ms
4,348 KB
testcase_07 AC 2 ms
4,348 KB
testcase_08 AC 2 ms
4,348 KB
testcase_09 AC 2 ms
4,348 KB
testcase_10 AC 2 ms
4,348 KB
testcase_11 AC 2 ms
4,348 KB
testcase_12 AC 2 ms
4,348 KB
testcase_13 AC 2 ms
4,348 KB
testcase_14 AC 2 ms
4,348 KB
testcase_15 AC 2 ms
4,348 KB
testcase_16 AC 2 ms
4,348 KB
testcase_17 AC 2 ms
4,348 KB
testcase_18 AC 2 ms
4,348 KB
testcase_19 AC 2 ms
4,348 KB
testcase_20 AC 2 ms
4,348 KB
testcase_21 AC 2 ms
4,348 KB
testcase_22 AC 2 ms
4,348 KB
testcase_23 AC 2 ms
4,348 KB
testcase_24 AC 2 ms
4,348 KB
testcase_25 AC 2 ms
4,348 KB
testcase_26 AC 2 ms
4,348 KB
testcase_27 AC 2 ms
4,348 KB
testcase_28 AC 2 ms
4,348 KB
testcase_29 AC 2 ms
4,348 KB
testcase_30 AC 2 ms
4,348 KB
testcase_31 AC 2 ms
4,348 KB
testcase_32 AC 2 ms
4,348 KB
testcase_33 AC 2 ms
4,348 KB
testcase_34 AC 2 ms
4,348 KB
testcase_35 AC 2 ms
4,348 KB
testcase_36 AC 2 ms
4,348 KB
testcase_37 AC 2 ms
4,348 KB
testcase_38 AC 2 ms
4,348 KB
testcase_39 AC 2 ms
4,348 KB
testcase_40 AC 2 ms
4,348 KB
testcase_41 AC 2 ms
4,348 KB
testcase_42 AC 2 ms
4,348 KB
testcase_43 AC 2 ms
4,348 KB
testcase_44 AC 2 ms
4,348 KB
testcase_45 AC 2 ms
4,348 KB
testcase_46 AC 2 ms
4,348 KB
testcase_47 AC 2 ms
4,348 KB
testcase_48 AC 2 ms
4,348 KB
testcase_49 AC 2 ms
4,348 KB
testcase_50 AC 2 ms
4,348 KB
testcase_51 AC 2 ms
4,348 KB
testcase_52 AC 2 ms
4,348 KB
testcase_53 AC 2 ms
4,348 KB
testcase_54 AC 2 ms
4,348 KB
testcase_55 AC 2 ms
4,348 KB
testcase_56 AC 2 ms
4,348 KB
testcase_57 AC 2 ms
4,348 KB
testcase_58 AC 2 ms
4,348 KB
testcase_59 AC 2 ms
4,348 KB
testcase_60 AC 2 ms
4,348 KB
testcase_61 AC 2 ms
4,348 KB
testcase_62 AC 2 ms
4,348 KB
testcase_63 AC 2 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

// https://github.com/pekempey/banana
// -------------------------------------------
// let is_prime n =
//   let mut i = 2 in
//   while i * i <= n do
//     if n % i == 0 then return false else ();
//     i += 1
//   done;
//   n >= 2
//   in
// 
// let is_square n =
//   for i = 1 to n do
//     if i * i == n then return true else ()
//   done;
//   false
//   in
// 
// let is_cube n =
//   for i = 1 to n do
//     if i * i * i == n then return true else ()
//   done;
//   false
//   in
// 
// let is_perfect n =
//   let mut s = 0 in
//   for i = 1 to n - 1 do
//     if n % i == 0 then
//       s += i
//     else ()
//   done;
//   n <> 0 and s == n
//   in
// 
// let n = readZ () in
// if is_prime n then
//   println "Sosu!"
// else if is_square n then
//   println "Heihosu!"
// else if is_cube n then
//   println "Ripposu!"
// else if is_perfect n then
//   println "Kanzensu!"
// else
//   println n
// -------------------------------------------
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <string>
template<class T> int print(T a) { std::cout << a; return 0; }
template<class T> int println(T a) { std::cout << a << '\n'; return 0; }
int print_newline(int dummy) { std::cout << '\n'; return 0; }
long long readZ(int dummy) { long long a; std::cin >> a; return a; }
long long readR(int dummy) { double a; std::cin >> a; return a; }
std::string readS(int dummy) { std::string a; std::cin >> a; return a; }
std::vector<long long> vecZ(long long n) { return std::vector<long long>(n, 0); }
std::vector<double> vecR(long long n) { return std::vector<double>(n, 0); }
long long sum(std::vector<long long> a) { long long res = 0; for (long long x : a) res += x; return res; }
template<class T> std::vector<T> sort(std::vector<T> a) { std::sort(a.begin(), a.end()); return a; }
int main() {
std::cin.tie(nullptr);
std::ios::sync_with_stdio(false);
std::cout << std::fixed << std::setprecision(15);
auto _15=[&](auto _14)->long long{
long long _29=2;
auto _27=_29;
while(true){
auto &_30=_27;
auto &_31=_27;
auto _32=_30*_31;
auto &_33=_14;
auto _34=_32<=_33;
if(!(_34))break;
auto &_35=_14;
auto &_36=_27;
auto _37=_35%_36;
long long _38=0;
auto _39=_37==_38;
long long _43;
if(_39){
long long _40=0;
int _41=0;
return _40;
_43=_41;
} else {
long long _42=0;
_43=_42;
}
long long _44=1;
_27+=_44;
auto _45=_44;
}
auto _46=0;
auto &_47=_14;
long long _48=2;
auto _49=_47>=_48;
auto _50=_49;
auto _51=_50;
return _51;};
auto _17=[&](auto _16)->long long{
long long _52=1;
auto &_53=_16;
for(long long _26=_52;_26<=_53;_26++){
auto &_54=_26;
auto &_55=_26;
auto _56=_54*_55;
auto &_57=_16;
auto _58=_56==_57;
long long _62;
if(_58){
long long _59=1;
int _60=0;
return _59;
_62=_60;
} else {
long long _61=0;
_62=_61;
}
}
auto _63=0;
long long _64=0;
auto _65=_64;
return _65;};
auto _19=[&](auto _18)->long long{
long long _66=1;
auto &_67=_18;
for(long long _25=_66;_25<=_67;_25++){
auto &_68=_25;
auto &_69=_25;
auto _70=_68*_69;
auto &_71=_25;
auto _72=_70*_71;
auto &_73=_18;
auto _74=_72==_73;
long long _78;
if(_74){
long long _75=1;
int _76=0;
return _75;
_78=_76;
} else {
long long _77=0;
_78=_77;
}
}
auto _79=0;
long long _80=0;
auto _81=_80;
return _81;};
auto _21=[&](auto _20)->long long{
long long _82=0;
auto _23=_82;
long long _83=1;
auto &_84=_20;
long long _85=1;
auto _86=_84-_85;
for(long long _24=_83;_24<=_86;_24++){
auto &_87=_20;
auto &_88=_24;
auto _89=_87%_88;
long long _90=0;
auto _91=_89==_90;
long long _94;
if(_91){
auto &_92=_24;
_23+=_92;
_94=_92;
} else {
long long _93=0;
_94=_93;
}
}
auto _95=0;
auto &_96=_20;
long long _97=0;
auto _98=_96!=_97;
auto &_99=_23;
auto &_100=_20;
auto _101=_99==_100;
auto _102=_98&&_101;
auto _103=_102;
auto _104=_103;
return _104;};
long long _105=0;
auto _106=readZ(_105);
auto _22=_106;
auto &_107=_22;
auto _108=_15(_107);
long long _128;
if(_108){
std::string _109="Sosu!";
auto _110=println(_109);
_128=_110;
} else {
auto &_111=_22;
auto _112=_17(_111);
long long _127;
if(_112){
std::string _113="Heihosu!";
auto _114=println(_113);
_127=_114;
} else {
auto &_115=_22;
auto _116=_19(_115);
long long _126;
if(_116){
std::string _117="Ripposu!";
auto _118=println(_117);
_126=_118;
} else {
auto &_119=_22;
auto _120=_21(_119);
long long _125;
if(_120){
std::string _121="Kanzensu!";
auto _122=println(_121);
_125=_122;
} else {
auto &_123=_22;
auto _124=println(_123);
_125=_124;
}
_126=_125;
}
_127=_126;
}
_128=_127;
}
auto _129=_128;
int _130=_129;
int _131=_130;
int _132=_131;
int _133=_132;
}
0