Submission #4218064


Source Code Expand

#include<stdio.h>
#include<stdlib.h>
#define ll long long int

int main(void){
  ll k, a, b;
  ll i = 0, count = 0, bis = 1, mon = 0;
  
  scanf("%lld %lld %lld", &k, &a, &b);
  
  if((a >= b) || (k < a + 2)){
    printf("%lld\n", k + 1);
    return 0;
  }
  
  while(i < k){
    if((bis >= a) & (k - i > 2) & (b - a > 1)){
      bis = bis - a + b;
      i = i + 2;
    } else {
      bis++;
      i++;
    }
  }
  
  printf("%lld\n", bis);
  
  return 0;
}

Submission Info

Submission Time
Task C - When I hit my pocket...
User obatatsu
Language C (GCC 5.4.1)
Score 0
Code Size 487 Byte
Status WA
Exec Time 871 ms
Memory 128 KiB

Compile Error

./Main.c: In function ‘main’:
./Main.c:9:3: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
   scanf("%lld %lld %lld", &k, &a, &b);
   ^

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 400
Status
AC × 2
WA × 1
AC × 11
WA × 4
Set Name Test Cases
Sample s1.txt, s2.txt, s3.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, s1.txt, s2.txt, s3.txt
Case Name Status Exec Time Memory
01.txt WA 548 ms 128 KiB
02.txt WA 578 ms 128 KiB
03.txt AC 455 ms 128 KiB
04.txt AC 726 ms 128 KiB
05.txt AC 1 ms 128 KiB
06.txt AC 774 ms 128 KiB
07.txt AC 871 ms 128 KiB
08.txt AC 1 ms 128 KiB
09.txt WA 1 ms 128 KiB
10.txt AC 0 ms 128 KiB
11.txt AC 219 ms 128 KiB
12.txt AC 1 ms 128 KiB
s1.txt AC 0 ms 128 KiB
s2.txt AC 1 ms 128 KiB
s3.txt WA 188 ms 128 KiB