Beginner ---- complexity

Source: Internet
Author: User

That TLE

The following describes the complexity.

#include  <cstdio>#include  <cstring>int main() {    __int64 sum1=1,sum2=1;    for(int i=1; i<=30; i++) {        sum1*=3;        sum2*=2;        printf("%2d\t%-12I64d%-12I64d\n",i,sum2,sum1);    }}/* 1      2           3 2      4           9 3      8           27 4      16          81 5      32          243 6      64          729 7      128         2187 8      256         6561 9      512         1968310      1024        5904911      2048        17714712      4096        53144113      8192        159432314      16384       478296915      32768       1434890716      65536       4304672117      131072      12914016318      262144      38742048919      524288      116226146720      1048576     348678440121      2097152     1046035320322      4194304     3138105960923      8388608     9414317882724      16777216    28242953648125      33554432    84728860944326      67108864    254186582832927      134217728   762559748498728      268435456   2287679245496129      536870912   6863037736488330      1073741824  205891132094649*/


Beginner ---- complexity

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.