Submission #46571976


Source Code Expand

#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, c;
  cin >> a;
  if (a % 2 == 1) {
    cout << "No" << endl;
  }
  else {
    int b;
    while (a % 2 == 0) {
      int b = (a / 2);
      if (a % 2 == 1) {
        break;
      }
    }
    while (a % 3 == 0) {
      int c = (b / 3);
      if (b % 3 != 0) {
        break;
      }
    }
  if (c != 0) {
    cout << "No" << endl;
  }
  else {
    cout << "Yes" << endl;
  }
  }
}

Submission Info

Submission Time
Task B - 3-smooth Numbers
User KUMAteacher
Language C++ 20 (gcc 12.2)
Score 0
Code Size 475 Byte
Status WA
Exec Time 1 ms
Memory 3652 KiB

Compile Error

Main.cpp: In function ‘int main()’:
Main.cpp:12:11: warning: unused variable ‘b’ [-Wunused-variable]
   12 |       int b = (a / 2);
      |           ^
Main.cpp:18:11: warning: unused variable ‘c’ [-Wunused-variable]
   18 |       int c = (b / 3);
      |           ^
Main.cpp:23:3: warning: ‘c’ may be used uninitialized [-Wmaybe-uninitialized]
   23 |   if (c != 0) {
      |   ^~
Main.cpp:4:10: note: ‘c’ was declared here
    4 |   int a, c;
      |          ^

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 200
Status
AC × 4
AC × 15
WA × 8
Set Name Test Cases
Sample 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt
All 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 01_handmade_04.txt, 01_handmade_05.txt, 01_handmade_06.txt, 02_random_07.txt, 02_random_08.txt, 02_random_09.txt, 02_random_10.txt, 02_random_11.txt, 02_random_12.txt, 02_random_13.txt, 02_random_14.txt, 02_random_15.txt, 02_random_16.txt, 02_random_17.txt, 02_random_18.txt, 02_random_19.txt, 02_random_20.txt, 02_random_21.txt, 02_random_22.txt
Case Name Status Exec Time Memory
00_sample_00.txt AC 1 ms 3572 KiB
00_sample_01.txt AC 1 ms 3452 KiB
00_sample_02.txt AC 1 ms 3496 KiB
00_sample_03.txt AC 1 ms 3572 KiB
01_handmade_04.txt WA 1 ms 3408 KiB
01_handmade_05.txt WA 1 ms 3460 KiB
01_handmade_06.txt AC 1 ms 3500 KiB
02_random_07.txt AC 1 ms 3464 KiB
02_random_08.txt AC 1 ms 3568 KiB
02_random_09.txt AC 1 ms 3572 KiB
02_random_10.txt AC 1 ms 3652 KiB
02_random_11.txt AC 1 ms 3372 KiB
02_random_12.txt WA 1 ms 3516 KiB
02_random_13.txt WA 1 ms 3440 KiB
02_random_14.txt WA 1 ms 3456 KiB
02_random_15.txt WA 1 ms 3444 KiB
02_random_16.txt AC 1 ms 3440 KiB
02_random_17.txt AC 1 ms 3572 KiB
02_random_18.txt WA 1 ms 3516 KiB
02_random_19.txt AC 1 ms 3448 KiB
02_random_20.txt WA 1 ms 3572 KiB
02_random_21.txt AC 1 ms 3508 KiB
02_random_22.txt AC 1 ms 3376 KiB