/ SeriousOJ /

Record Detail

Compile Error

foo.c: In function 'main':
foo.c:11:21: error: expected '=', ',', ';', 'asm' or '__attribute__' before '-' token
   11 |         long long p - q = x;
      |                     ^
foo.c:11:25: error: lvalue required as left operand of assignment
   11 |         long long p - q = x;
      |                         ^
foo.c:13:13: error: 'p' undeclared (first use in this function)
   13 |         if (p >= l && p <= r) {
      |             ^
foo.c:13:13: note: each undeclared identifier is reported only once for each function it appears in

Code

#include <stdio.h>

int main() {
    int t;
    scanf("%d", &t);
    while (t--) {
        long long l, r, x;
        scanf("%lld %lld %lld", &l, &r, &x);

        long long q = l;
        long long p - q = x;

        if (p >= l && p <= r) {
            printf("%lld %lld\n", p, q);
        } else {
            printf("-1 -1\n");
        }
    }
    return 0;
}

Information

Submit By
Type
Submission
Problem
P1186 Equal to X
Contest
Brain Booster #9
Language
C99 (GCC 13.2.0)
Submit At
2025-04-06 16:35:42
Judged At
2025-04-06 16:35:42
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes