Submission #160312

#TimeUsernameProblemLanguageResultExecution timeMemory
160312model_codeSplit (info1cup19_split)C++17
100 / 100
2 ms376 KiB
#include <bits/stdc++.h>

using namespace std;
int y,nr,i,a[20];
long long x,z;
int main()
{
    scanf ("%lld", &x);
    assert ((x>=1) && (x<1000000000000000000LL));
    z=(0LL)+x;
    nr=0;
    while (z!=0)
    {
        nr++;
        z/=10;
    }
    assert ((nr%2)==0);
    nr=0;
    while (x>0)
    {
        a[++nr]=x%10;
        x/=10;
    }
    y=0;
    for (i=nr;i>=((nr/2)+1);i--)
        y=y*10+a[i];
    z=0;
    for (i=(nr/2);i>=1;i--)
        z=z*10+a[i];
    printf ("%d %d\n", y, z);
    return 0;
}

Compilation message (stderr)

split.cpp: In function 'int main()':
split.cpp:30:28: warning: format '%d' expects argument of type 'int', but argument 3 has type 'long long int' [-Wformat=]
     printf ("%d %d\n", y, z);
                            ^
split.cpp:8:11: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf ("%lld", &x);
     ~~~~~~^~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...