Submission #1114490
Source Code Expand
#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
#define prev aewrxew
#define next fawexsr
using namespace std;
typedef int ll;
typedef long double ld;
const ll inf = numeric_limits<ll>::max() / 2 - 1;
const ld eps = 1e-7;
const ll mod = 1e9 + 7;
const ll maxn = 2456;
signed run() {
ll n, m;
cin >> n >> m;
ll ans = min(n, m / 2);
n -= ans;
m -= ans * 2;
if (n == 0) {
ans += m / 4;
}
cout << ans;
return 0;
}
signed main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
#ifdef LOCAL
freopen("input.txt", "r", stdin);
#else
#define TASK ""
if(strlen(TASK)>0) {
freopen(TASK".in","r",stdin);
freopen(TASK".out","w",stdout);
}
#endif
run();
cout.flush();
cerr << "time: " << clock() * 1000 / CLOCKS_PER_SEC << endl;
return 0;
}
Submission Info
Submission Time |
|
Task |
C - Scc Puzzle |
User |
Krock |
Language |
C++14 (GCC 5.4.1) |
Score |
0 |
Code Size |
896 Byte |
Status |
WA |
Exec Time |
1 ms |
Memory |
256 KB |
Compile Error
./Main.cpp: In function ‘int main()’:
./Main.cpp:37:37: warning: ignoring return value of ‘FILE* freopen(const char*, const char*, FILE*)’, declared with attribute warn_unused_result [-Wunused-result]
freopen(TASK".in","r",stdin);
^
./Main.cpp:38:39: warning: ignoring return value of ‘FILE* freopen(const char*, const char*, FILE*)’, declared with attribute warn_unused_result [-Wunused-result]
freopen(TASK".out","w",stdout);
^
Judge Result
Set Name |
Sample |
All |
Score / Max Score |
0 / 0 |
0 / 300 |
Status |
|
|
Set Name |
Test Cases |
Sample |
00_example_01.txt, 00_example_02.txt |
All |
00_example_01.txt, 00_example_02.txt, 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt |
Case Name |
Status |
Exec Time |
Memory |
00_example_01.txt |
AC |
1 ms |
256 KB |
00_example_02.txt |
AC |
1 ms |
256 KB |
01.txt |
WA |
1 ms |
256 KB |
02.txt |
WA |
1 ms |
256 KB |
03.txt |
WA |
1 ms |
256 KB |
04.txt |
AC |
1 ms |
256 KB |
05.txt |
AC |
1 ms |
256 KB |
06.txt |
AC |
1 ms |
256 KB |
07.txt |
AC |
1 ms |
256 KB |