Submission #160312

# Submission time Handle Problem Language Result Execution time Memory
160312 2019-10-27T01:29:01 Z model_code Split (info1cup19_split) C++17
100 / 100
2 ms 376 KB
#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

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 time Memory Grader output
1 Correct 2 ms 252 KB Output is correct
2 Correct 2 ms 256 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
4 Correct 2 ms 256 KB Output is correct
5 Correct 2 ms 252 KB Output is correct
6 Correct 2 ms 256 KB Output is correct
7 Correct 2 ms 256 KB Output is correct
8 Correct 2 ms 376 KB Output is correct
9 Correct 2 ms 376 KB Output is correct
10 Correct 2 ms 256 KB Output is correct
11 Correct 2 ms 376 KB Output is correct
12 Correct 2 ms 256 KB Output is correct
13 Correct 2 ms 376 KB Output is correct
14 Correct 2 ms 256 KB Output is correct
15 Correct 2 ms 376 KB Output is correct
16 Correct 2 ms 376 KB Output is correct
17 Correct 2 ms 376 KB Output is correct
18 Correct 2 ms 256 KB Output is correct
19 Correct 2 ms 376 KB Output is correct
20 Correct 2 ms 256 KB Output is correct