Language: C++

##!/usr/bin/env python3
import sys
from operator import itemgetter
# gcd
# from fractions import gcd
# 切り上げ，切り捨て
# from math import ceil, floor
# リストの真のコピー（変更が伝播しない）
# from copy import deepcopy
# 累積和。list(accumulate(A))としてAの累積和
# from itertools import accumulate
# l = ['a', 'b', 'b', 'c', 'b', 'a', 'c', 'c', 'b', 'c', 'b', 'a']
# S = Counter(l)  # カウンタークラスが作られる。S=Counter({'b': 5, 'c': 4, 'a': 3})
# print(S.most_common(2))  # [('b', 5), ('c', 4)]
# print(S.keys())  # dict_keys(['a', 'b', 'c'])
# print(S.values())  # dict_values([3, 5, 4])
# print(S.items())  # dict_items([('a', 3), ('b', 5), ('c', 4)])
# from collections import Counter
# import math
# from functools import reduce
#
# input関係の定義
fin = open('in_1.txt', 'r')
sys.stdin = fin
# 提出時はコメントアウト+上のshebangを有効にする
input = sys.stdin.readline
def ii(): return int(input())
def mi(): return map(int, input().rstrip().split())
def lmi(): return list(map(int, input().rstrip().split()))
def li(): return list(input().rstrip())
# template

MOD = 1000000007  # type: int

def iterate_tokens():
    for line in sys.stdin:
        for word in line.split():
            yield word


if __name__ == '__main__':

    tokens = iterate_tokens()
    L = list(map(int,list(str(next(tokens)))))  # type: int
    memo = [pow(3,i,MOD)+2 for i in range(10**5)]
    # write code
    print(L)
    cnt = 0
    lenL = len(L)
    for i in range(len(L)):
        if L[lenL-i-1] == 1:
            minL = i
    print(minL)
    for i in range(lenL, minL, -1):
        cnt += pow(3, i, MOD)
    print(cnt+minL)


Compiler output:
a.cc:1:1: error: stray '##' in program
    1 | ##!/usr/bin/env python3
      | ^~
a.cc:4:3: error: invalid preprocessing directive #gcd
    4 | # gcd
      |   ^~~
a.cc:5:3: error: invalid preprocessing directive #from
    5 | # from fractions import gcd
      |   ^~~~
a.cc:6:3: error: invalid preprocessing directive #\U00005207\U0000308a\U00004e0a\U00003052\U0000ff0c\U00005207\U0000308a\U00006368\U00003066
    6 | # 切り上げ，切り捨て
      |   ^~~~~~~~~~~~~~~~~~
a.cc:7:3: error: invalid preprocessing directive #from
    7 | # from math import ceil, floor
      |   ^~~~
a.cc:8:3: error: invalid preprocessing directive #\U000030ea\U000030b9\U000030c8\U0000306e\U0000771f\U0000306e\U000030b3\U000030d4\U000030fc\U0000ff08\U00005909\U000066f4\U0000304c\U00004f1d\U000064ad\U00003057\U0000306a\U00003044\U0000ff09
    8 | # リストの真のコピー（変更が伝播しない）
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:9:3: error: invalid preprocessing directive #from
    9 | # from copy import deepcopy
      |   ^~~~
a.cc:10:3: error: extended character 。 is not valid in an identifier
   10 | # 累積和。list(accumulate(A))としてAの累積和
      |   ^
a.cc:10:3: error: invalid preprocessing directive #\U00007d2f\U00007a4d\U0000548c\U00003002list
   10 | # 累積和。list(accumulate(A))としてAの累積和
      |   ^~~~~~~~~~~~
a.cc:11:3: error: invalid preprocessing directive #from
   11 | # from itertools import accumulate
      |   ^~~~
a.cc:12:3: error: invalid preprocessing directive #l
   12 | # l = ['a', 'b', 'b', 'c', 'b', 'a', 'c', 'c', 'b', 'c', 'b', 'a']
      |   ^
a.cc:13:3: error: invalid preprocessing directive #S
   13 | # S = Counter(l)  # カウンタークラスが作られる。S=Counter({'b': 5, 'c': 4, 'a': 3})
      |   ^
a.cc:13:21: error: extended character 。 is not valid in an identifier
   13 | # S = Counter(l)  # カウンタークラスが作られる。S=Counter({'b': 5, 'c': 4, 'a': 3})
      |                     ^
a.cc:14:3: error: invalid preprocessing directive #print
   14 | # print(S.most_common(2))  # [('b', 5), ('c', 4)]
      |   ^~~~~
a.cc:15:3: error: invalid preprocessing directive #print
   15 | # print(S.keys())  # dict_keys(['a', 'b', 'c'])
      |   ^~~~~
a.cc:16:3: error: invalid preprocessing directive #print
   16 | # print(S.values())  # dict_values([3, 5, 4])
      |   ^~~~~
a.cc:17:3: error: invalid preprocessing directive #print
   17 | # print(S.items())  # dict_items([('a', 3), ('b', 5), ('c', 4)])
      |   ^~~~~
a.cc:18:3: error: invalid preprocessing directive #from
   18 | # from collections import Counter
      |   ^~~~
a.cc:19:3: warning: #import is a deprecated GCC extension [-Wdeprecated]
   19 | # import math
      |   ^~~~~~
a.cc:19:10: error: #import expects "FILENAME" or <FILENAME>
   19 | # import math
      |          ^~~~
a.cc:20:3: error: invalid preprocessing directive #from
   20 | # from functools import reduce
      |   ^~~~
a.cc:22:3: error: invalid preprocessing directive #input\U000095a2\U00004fc2\U0000306e\U00005b9a\U00007fa9
   22 | # input関係の定義
      |   ^~~~~~~~~~~~~~~
a.cc:23:12: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
   23 | fin = open('in_1.txt', 'r')
      |            ^~~~~~~~~~
a.cc:25:3: error: invalid preprocessing directive #\U000063d0\U000051fa\U00006642\U0000306f\U000030b3\U000030e1\U000030f3\U000030c8\U000030a2\U000030a6\U000030c8
   25 | # 提出時はコメントアウト+上のshebangを有効にする
      |   ^~~~~~~~~~~~~~~~~~~~~~
a.cc:31:3: error: invalid preprocessing directive #template
   31 | # template
      |   ^~~~~~~~
a.cc:33:19: error: stray '#' in program
   33 | MOD = 1000000007  # type: int
      |                   ^
a.cc:41:16: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
   41 | if __name__ == '__main__':
      |                ^~~~~~~~~~
a.cc:44:49: error: stray '#' in program
   44 |     L = list(map(int,list(str(next(tokens)))))  # type: int
      |                                                 ^
a.cc:46:7: error: invalid preprocessing directive #write
   46 |     # write code
      |       ^~~~~
a.cc:1:3: error: expected unqualified-id before '!' token
    1 | ##!/usr/bin/env python3
      |   ^