Submission #15180554


Source Code Expand

#include <iostream>
#include <string>

using namespace std;

int f(bitset<100000> bit){
  int ans = 0;
  while(bit.count() != 0){
    long long x = (long long)(bit.to_ullong()) % bit.count();
    bit = bitset<100000>(x);
    ans += 1;
  }
  return ans;
}

int main(){
  int n;
  string x;
  std::cin >> n;
  std::cin >> x;

  bitset<100000> bit(x);

  for(int i=n-1; 0 <= i ; i--){
    bit.flip(i);
    std::cout << f(bit) << '\n';
    bit.flip(i);
  }

  return 0;
}

Submission Info

Submission Time
Task D - Anything Goes to Zero
User shrimpName
Language C++ (Clang 10.0.0)
Score 0
Code Size 499 Byte
Status RE
Exec Time 160 ms
Memory 3520 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 400
Status
AC × 2
AC × 4
RE × 17
Set Name Test Cases
Sample sample_01.txt, sample_02.txt
All hand_01.txt, hand_02.txt, hand_03.txt, hand_04.txt, hand_05.txt, hand_06.txt, hand_07.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, sample_01.txt, sample_02.txt
Case Name Status Exec Time Memory
hand_01.txt AC 10 ms 3220 KiB
hand_02.txt AC 3 ms 3120 KiB
hand_03.txt RE 160 ms 3192 KiB
hand_04.txt RE 109 ms 2992 KiB
hand_05.txt RE 112 ms 3404 KiB
hand_06.txt RE 114 ms 3488 KiB
hand_07.txt RE 111 ms 3328 KiB
random_01.txt RE 115 ms 3520 KiB
random_02.txt RE 116 ms 3452 KiB
random_03.txt RE 112 ms 3392 KiB
random_04.txt RE 114 ms 3452 KiB
random_05.txt RE 111 ms 3248 KiB
random_06.txt RE 106 ms 3192 KiB
random_07.txt RE 112 ms 3360 KiB
random_08.txt RE 109 ms 3168 KiB
random_09.txt RE 113 ms 3228 KiB
random_10.txt RE 108 ms 3256 KiB
random_11.txt RE 111 ms 3360 KiB
random_12.txt RE 109 ms 3312 KiB
sample_01.txt AC 4 ms 3064 KiB
sample_02.txt AC 2 ms 3172 KiB