fork download
  1. #pragma GCC optimize("Ofast")
  2. #pragma GCC optimize("unroll-loops")
  3. #pragma GCC optimize("inline")
  4. #include<bits/stdc++.h>
  5. using namespace std;
  6. inline int my_getchar_unlocked(){
  7. static char buf[1048576];
  8. static int s = 1048576;
  9. static int e = 1048576;
  10. if(s == e && e == 1048576){
  11. e = fread_unlocked(buf, 1, 1048576, stdin);
  12. s = 0;
  13. }
  14. if(s == e){
  15. return EOF;
  16. }
  17. return buf[s++];
  18. }
  19. inline void rd(char &c){
  20. int i;
  21. for(;;){
  22. i = my_getchar_unlocked();
  23. if(i!=' '&&i!='\n'&&i!='\r'&&i!='\t'&&i!=EOF){
  24. break;
  25. }
  26. }
  27. c = i;
  28. }
  29. inline int rd(char c[]){
  30. int i;
  31. int sz = 0;
  32. for(;;){
  33. i = my_getchar_unlocked();
  34. if(i!=' '&&i!='\n'&&i!='\r'&&i!='\t'&&i!=EOF){
  35. break;
  36. }
  37. }
  38. c[sz++] = i;
  39. for(;;){
  40. i = my_getchar_unlocked();
  41. if(i==' '||i=='\n'||i=='\r'||i=='\t'||i==EOF){
  42. break;
  43. }
  44. c[sz++] = i;
  45. }
  46. c[sz]='\0';
  47. return sz;
  48. }
  49. struct MY_WRITER{
  50. char buf[1048576];
  51. int s;
  52. int e;
  53. MY_WRITER(){
  54. s = 0;
  55. e = 1048576;
  56. }
  57. ~MY_WRITER(){
  58. if(s){
  59. fwrite_unlocked(buf, 1, s, stdout);
  60. }
  61. }
  62. }
  63. ;
  64. MY_WRITER MY_WRITER_VAR;
  65. void my_putchar_unlocked(int a){
  66. if(MY_WRITER_VAR.s == MY_WRITER_VAR.e){
  67. fwrite_unlocked(MY_WRITER_VAR.buf, 1, MY_WRITER_VAR.s, stdout);
  68. MY_WRITER_VAR.s = 0;
  69. }
  70. MY_WRITER_VAR.buf[MY_WRITER_VAR.s++] = a;
  71. }
  72. inline void wt_L(char a){
  73. my_putchar_unlocked(a);
  74. }
  75. inline void wt_L(const char c[]){
  76. int i=0;
  77. for(i=0;c[i]!='\0';i++){
  78. my_putchar_unlocked(c[i]);
  79. }
  80. }
  81. template<class T, class S> int arrCountVal(int N, T A[], S val){
  82. int i;
  83. int res = 0;
  84. for(i=(0);i<(N);i++){
  85. if(A[i]==val){
  86. res++;
  87. }
  88. }
  89. return res;
  90. }
  91. template<class S> int arrCountVal(string A, S val){
  92. int i;
  93. int res = 0;
  94. for(i=(0);i<(A.size());i++){
  95. if(A[i]==val){
  96. res++;
  97. }
  98. }
  99. return res;
  100. }
  101. int main(){
  102. char S[6];
  103. int N;
  104. N = rd(S);
  105. if(arrCountVal(N,S,'0')){
  106. wt_L("YES");
  107. wt_L('\n');
  108. }
  109. else{
  110. wt_L("NO");
  111. wt_L('\n');
  112. }
  113. return 0;
  114. }
  115. // cLay version 20210904-1
  116.  
  117. // --- original code ---
  118. // {
  119. // char S[6]; int N;
  120. // rd(S@N);
  121. // wt(if[arrCountVal(N,S,'0'), "YES", "NO"]);
  122. // }
  123.  
Time limit exceeded #stdin #stdout 5s 5460KB
stdin
Standard input is empty
stdout
Standard output is empty