Submission #3621076


Source Code Expand

#include<bits/stdc++.h>
using namespace std;
typedef long long unsigned int ll;


// definition {{{ 1

// scaning {{{ 2
#define Scd(x) scanf("%d", &x)
#define Scd2(x,y) scanf("%d%d", &x, &y)
#define Scd3(x,y,z) scanf("%d%d%d", &x, &y, &z)

#define Scll(x) scanf("%llu", &x)
#define Scll2(x,y) scanf("%llu%llu", &x, &y)
#define Scll3(x,y,z) scanf("%llu%llu%llu", &x, &y, &z)

#define Scc(c) scanf("%c", &c);
#define Scs(s) scanf("%s", s);
#define Scstr(s) scanf("%s", &s);
// }}} 2

// constants {{{ 2
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
// }}} 2

// systems {{{ 2
#define Rep(x,y) for(int x = 0; x < y; x++)
#define Repe(x,y,z) for(int x = z; x < y; x++)
// }}} 2

// output {{{ 2
#define YesNo(a) (a)?printf("Yes\n"):printf("No\n");
// }}} 2

// }}} 1

ll mod = INF+7;

// PowMod( base, index, modulo) return base ** index % modulo {{{
// PowMod = base ** index % mod ( natural numbers )
long long unsigned int PowMod( long long unsigned int base, long long unsigned int index, long long unsigned int modulo = mod ){
    if( index == 0 ) return 1;
    // O( log(index) )
    if( index % 2 ){
        return base * PowMod(base, index - 1, modulo) % modulo;
    }else{
        long long unsigned int Phalf = index / 2;
        long long unsigned int half = PowMod(base, Phalf, modulo);
        return half * half % modulo;
    }
}

// }}}



int main() {

    int n;

    Scd(n);

    int ans = 34;
    int b = 0;

    int t = n;

    int hit[21] = {};

    int leng = pow(2,17);
    for( int i = 18 ; i > 1; i-- ){
        if( (leng - 1) < n ){
            n -= (leng - 1);
            hit[i] = n;
            ans++;
        }
        leng >>= 1;
    }

    int len = 1;
    printf ("%d %d\n", 19, ans);
    Rep(i,17){
        printf ("%d %d %d\n", i+1, i+2, len);
        printf ("%d %d %d\n", i+1, i+2, 0);
        len *= 2;
    }

    Rep(i,20){
        if( hit[i] )
        printf ("%d %d %d\n", i, 19, hit[i]);
    }



    return 0;
}

Submission Info

Submission Time
Task D - All Your Paths are Different Lengths
User nishionyama
Language C++14 (GCC 5.4.1)
Score 0
Code Size 2064 Byte
Status WA
Exec Time 1 ms
Memory 256 KB

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:63:11: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
     Scd(n);
           ^

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 700
Status
WA × 2
WA × 22
Set Name Test Cases
Sample s1.txt, s2.txt
All 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, 11.txt, 12.txt, 13.txt, 14.txt, 15.txt, 16.txt, 17.txt, 18.txt, 19.txt, 20.txt, s1.txt, s2.txt
Case Name Status Exec Time Memory
01.txt WA 1 ms 256 KB
02.txt WA 1 ms 256 KB
03.txt WA 1 ms 256 KB
04.txt WA 1 ms 256 KB
05.txt WA 1 ms 256 KB
06.txt WA 1 ms 256 KB
07.txt WA 1 ms 256 KB
08.txt WA 1 ms 256 KB
09.txt WA 1 ms 256 KB
10.txt WA 1 ms 256 KB
11.txt WA 1 ms 256 KB
12.txt WA 1 ms 256 KB
13.txt WA 1 ms 256 KB
14.txt WA 1 ms 256 KB
15.txt WA 1 ms 256 KB
16.txt WA 1 ms 256 KB
17.txt WA 1 ms 256 KB
18.txt WA 1 ms 256 KB
19.txt WA 1 ms 256 KB
20.txt WA 1 ms 256 KB
s1.txt WA 1 ms 256 KB
s2.txt WA 1 ms 256 KB