Submission #3049455


Source Code Expand

Copy
#include <bits/stdc++.h>

using namespace std;

using int64 = long long;

int main() {
  string S;
  int64 K;
  cin >> S >> K;
  for(int i = 0; i < S.size(); i++) {
    if(S[i] == '1') --K;
    else K = 0;
    if(K == 0) {
      cout << S[i] << endl;
      return 0;
    }
  }
}





Submission Info

Submission Time
Task C - To Infinity
User ei13333
Language C++14 (GCC 5.4.1)
Score 300
Code Size 308 Byte
Status
Exec Time 1 ms
Memory 256 KB

Judge Result

Set Name Score / Max Score Test Cases
Sample 0 / 0 s1.txt, s2.txt, s3.txt
All 300 / 300 in01.txt, in02.txt, in03.txt, in04.txt, in05.txt, in06.txt, in07.txt, in08.txt, in09.txt, in10.txt, in11.txt, in12.txt, in13.txt, s1.txt, s2.txt, s3.txt
Case Name Status Exec Time Memory
in01.txt 1 ms 256 KB
in02.txt 1 ms 256 KB
in03.txt 1 ms 256 KB
in04.txt 1 ms 256 KB
in05.txt 1 ms 256 KB
in06.txt 1 ms 256 KB
in07.txt 1 ms 256 KB
in08.txt 1 ms 256 KB
in09.txt 1 ms 256 KB
in10.txt 1 ms 256 KB
in11.txt 1 ms 256 KB
in12.txt 1 ms 256 KB
in13.txt 1 ms 256 KB
s1.txt 1 ms 256 KB
s2.txt 1 ms 256 KB
s3.txt 1 ms 256 KB