Submission #57281161
Source Code Expand
Copy
#include <bits/stdc++.h>#define int long longusing namespace std;map<int,int> ok;signed main(){int a,b;cin >> a >> b;if ((a + b) % 2 == 0) ok[(a + b) / 2] = 1;if (a > b) swap(a,b);ok[2 * a - b] = 1;ok[2 * b - a] = 1;printf("%lld\n",ok.size());return 0;}
#include <bits/stdc++.h> #define int long long using namespace std; map<int,int> ok; signed main() { int a,b; cin >> a >> b; if ((a + b) % 2 == 0) ok[(a + b) / 2] = 1; if (a > b) swap(a,b); ok[2 * a - b] = 1; ok[2 * b - a] = 1; printf("%lld\n",ok.size()); return 0; }
Submission Info
Submission Time | |
---|---|
Task | A - 369 |
User | Hyh12377 |
Language | C++ 20 (gcc 12.2) |
Score | 100 |
Code Size | 291 Byte |
Status | AC |
Exec Time | 1 ms |
Memory | 3804 KB |
Compile Error
Main.cpp: In function ‘int main()’: Main.cpp:14:20: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 2 has type ‘std::map<long long int, long long int>::size_type’ {aka ‘long unsigned int’} [-Wformat=] 14 | printf("%lld\n",ok.size()); | ~~~^ ~~~~~~~~~ | | | | | std::map<long long int, long long int>::size_type {aka long unsigned int} | long long int | %ld
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 100 / 100 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt |
All | 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 01_random_00.txt, 01_random_01.txt, 01_random_02.txt, 01_random_03.txt, 01_random_04.txt, 02_handmade_00.txt, 02_handmade_01.txt, 02_handmade_02.txt, 02_handmade_03.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
00_sample_00.txt | AC | 1 ms | 3744 KB |
00_sample_01.txt | AC | 1 ms | 3740 KB |
00_sample_02.txt | AC | 1 ms | 3672 KB |
01_random_00.txt | AC | 1 ms | 3772 KB |
01_random_01.txt | AC | 1 ms | 3624 KB |
01_random_02.txt | AC | 1 ms | 3804 KB |
01_random_03.txt | AC | 1 ms | 3588 KB |
01_random_04.txt | AC | 1 ms | 3756 KB |
02_handmade_00.txt | AC | 1 ms | 3616 KB |
02_handmade_01.txt | AC | 1 ms | 3556 KB |
02_handmade_02.txt | AC | 1 ms | 3596 KB |
02_handmade_03.txt | AC | 1 ms | 3744 KB |