Submission #2766436


Source Code Expand

Copy
#include <bits/stdc++.h>
using namespace std;
#define all(cont) cont.begin(), cont.end()
#define rall(cont) cont.end(), cont.begin()
#define mp make_pair
#define pb push_back
#define fs first
#define sc second
#define fr(i, a, b) for(int i = a ; i < b ; i++)
#define frr(i, a, b) for(int i = a ; i >= b ; i--)
#define tr(it, var) for(__typeof(var.begin()) it = var.begin(); it != var.end(); it++)
#define trr(rit, var) for(__typeof(var.rbegin()) rit = var.rbegin(); rit != var.rend(); rit++)
#define its(x) static_cast< ostringstream & >( ( ostringstream() << dec << x ) ).str() // int to string
#define fill1(a, c, x) fr(_I, 0, (c)) (a)[_I] = (x);
#define fill2(a, r, c, x) fr(_I, 0, (r)) fr(_J, 0, (c)) (a)[_I][_J] = (x);
#define sz(x) ((int)(x).size())
#define deb(x) cout << #x" = " << x << '\n';
typedef long long ll;
typedef unsigned long long ull;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#include <bits/stdc++.h>
using namespace std;

#define all(cont) cont.begin(), cont.end()
#define rall(cont) cont.end(), cont.begin()
#define mp make_pair
#define pb push_back
#define fs first
#define sc second
#define fr(i, a, b) for(int i = a ; i < b ; i++)
#define frr(i, a, b) for(int i = a ; i >= b ; i--)
#define tr(it, var) for(__typeof(var.begin()) it = var.begin(); it != var.end(); it++)
#define trr(rit, var) for(__typeof(var.rbegin()) rit = var.rbegin(); rit != var.rend(); rit++)
#define its(x) static_cast< ostringstream & >( ( ostringstream() << dec << x ) ).str() // int to string
#define fill1(a, c, x) fr(_I, 0, (c)) (a)[_I] = (x);
#define fill2(a, r, c, x) fr(_I, 0, (r)) fr(_J, 0, (c)) (a)[_I][_J] = (x);
#define sz(x) ((int)(x).size())
#define deb(x) cout << #x" = " << x << '\n';

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef vector<int> vi;

ull x;

int main() {
//    freopen("input.in", "r", stdin);
	scanf("%I64d", &x);
	if(x % 2 == 0) printf("%I64d", x);
	else printf("%I64d", x*2LL);
	return 0;
}

Submission Info

Submission Time
Task A - Multiple of 2 and N
User sph_mp
Language C++14 (GCC 5.4.1)
Score 100
Code Size 1101 Byte
Status AC
Exec Time 1 ms
Memory 256 KB

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:29:19: warning: format ‘%d’ expects argument of type ‘int*’, but argument 2 has type ‘ull* {aka long long unsigned int*}’ [-Wformat=]
  scanf("%I64d", &x);
                   ^
./Main.cpp:30:34: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘ull {aka long long unsigned int}’ [-Wformat=]
  if(x % 2 == 0) printf("%I64d", x);
                                  ^
./Main.cpp:31:28: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long long unsigned int’ [-Wformat=]
  else printf("%I64d", x*2LL);
                            ^
./Main.cpp:29:20: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
  scanf("%I64d", &x);
                    ^

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 100 / 100
Status
AC × 3
AC × 15
Set Name Test Cases
Sample sample_01.txt, sample_02.txt, sample_03.txt
All sample_01.txt, sample_02.txt, sample_03.txt, sample_01.txt, sample_02.txt, sample_03.txt, subtask_1_01.txt, subtask_1_02.txt, subtask_1_03.txt, subtask_1_04.txt, subtask_1_05.txt, subtask_1_06.txt, subtask_1_07.txt, subtask_1_08.txt, subtask_1_09.txt
Case Name Status Exec Time Memory
sample_01.txt AC 1 ms 256 KB
sample_02.txt AC 1 ms 256 KB
sample_03.txt AC 1 ms 256 KB
subtask_1_01.txt AC 1 ms 256 KB
subtask_1_02.txt AC 1 ms 256 KB
subtask_1_03.txt AC 1 ms 256 KB
subtask_1_04.txt AC 1 ms 256 KB
subtask_1_05.txt AC 1 ms 256 KB
subtask_1_06.txt AC 1 ms 256 KB
subtask_1_07.txt AC 1 ms 256 KB
subtask_1_08.txt AC 1 ms 256 KB
subtask_1_09.txt AC 1 ms 256 KB


2025-02-28 (Fri)
05:22:40 +00:00