Submission #6492493


Source Code Expand

#include <bits/stdc++.h>
using namespace std;
using LL = long long; using PII = pair<LL, LL>; using VI = vector<LL>; using VVI = vector<VI>;
using VB = vector<bool>; using VS = vector<string>; using VP = vector<PII>;
#define VV(T)        vector<vector<T>>
#define PB           push_back
#define MP           make_pair
#define SZ(a)        LL((a).size())
#define EACH(x, c)   for (auto x : (c))
#define ALL(c)       (c).begin(), (c).end()
#define REVERSE(c)   reverse(ALL(c))
#define SORT(c)      stable_sort(ALL(c))
#define RSORT(c)     stable_sort((c).rbegin(), (c).rend())
#define FOR(i, a, b) for (LL i = (a); i < (b); ++i)
#define REP(i, n)    FOR(i, 0, n)
#define $(x)         {cout << #x << " = " << (x) << endl;}


void solve(LL S){
    LL y2 = (LL)ceil(sqrt((double)S));
    LL x3 = y2;
    LL remain = y2 * x3 - S;
    LL x2;
    if (remain == 0) x2 = 0;
    else x2 = 1;
    cout << "0 0 " << x2 << " " << y2 << " " << x3 << " " << remain << endl;
}

int main(){
    LL S;
    scanf("%lld",&S);
    solve(S);
    return 0;
}

Submission Info

Submission Time
Task A - Triangle
User yetnone
Language C++14 (GCC 5.4.1)
Score 400
Code Size 1069 Byte
Status AC
Exec Time 2 ms
Memory 256 KiB

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:31:21: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
     scanf("%lld",&S);
                     ^

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 400 / 400
Status
AC × 3
AC × 16
Set Name Test Cases
Sample sample-01.txt, sample-02.txt, sample-03.txt
All 01-01.txt, 01-02.txt, 01-03.txt, 01-04.txt, 01-05.txt, 01-06.txt, 01-07.txt, 01-08.txt, 01-09.txt, 01-10.txt, 01-11.txt, 01-12.txt, 01-13.txt, sample-01.txt, sample-02.txt, sample-03.txt
Case Name Status Exec Time Memory
01-01.txt AC 1 ms 256 KiB
01-02.txt AC 2 ms 256 KiB
01-03.txt AC 1 ms 256 KiB
01-04.txt AC 1 ms 256 KiB
01-05.txt AC 1 ms 256 KiB
01-06.txt AC 1 ms 256 KiB
01-07.txt AC 1 ms 256 KiB
01-08.txt AC 1 ms 256 KiB
01-09.txt AC 1 ms 256 KiB
01-10.txt AC 1 ms 256 KiB
01-11.txt AC 1 ms 256 KiB
01-12.txt AC 1 ms 256 KiB
01-13.txt AC 1 ms 256 KiB
sample-01.txt AC 1 ms 256 KiB
sample-02.txt AC 1 ms 256 KiB
sample-03.txt AC 1 ms 256 KiB