Submission #1114938
Source Code Expand
#include <iostream>
#include <cstdio>
#include <vector>
#include <cmath>
#include <cstring>
#include <numeric>
#include <algorithm>
#include <functional>
#include <array>
#include <map>
#include <queue>
#include <limits.h>
#include <set>
#include <stack>
#include <random>
#include <complex>
#include <unordered_map>
#define rep(i,s,n) for(int i = (s); (n) > i; i++)
#define REP(i,n) rep(i,0,n)
#define RANGE(x,a,b) ((a) <= (x) && (x) < (b))
#define DUPLE(a,b,c,d) (RANGE(a,c,d) || RANGE(b,c,d) || RANGE(c,a,b) || RANGE(d,a,b))
#define INCLU(a,b,c,d) (RANGE(a,c,d) && (b,c,d))
#define PW(x) ((x)*(x))
#define ALL(x) (x).begin(), (x).end()
#define RALL(x) (x).rbegin(), (x).rend()
#define MODU 1000000007
#define bitcheck(a,b) ((a >> b) & 1)
#define bitset(a,b) ( a |= (1 << b))
#define bitunset(a,b) (a &= ~(1 << b))
#define MP(a,b) make_pair((a),(b))
#define Manh(a,b) (abs((a).first-(b).first) + abs((a).second - ((b).second))
#define pritnf printf
#define scnaf scanf
#define itn int
#define PI 3.141592653589
#define izryt bool
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
template<typename A, size_t N, typename T>
void Fill(A(&array)[N], const T &val) {
std::fill((T*) array, (T*) (array + N), val);
}
pii Dir[8] = { //移動
{ 0 ,1 },{ -1 ,0 },{ 1 ,0 },{ 0 ,-1 },
{ 1 ,1 },{ 1 ,-1 },{ -1 ,1 },{ -1 ,-1 }
};
ll mod_pow(ll x, ll n, int mod) {
ll res = 1;
while (n > 0) {
if (n & 1) res = res * x%mod;
x = x*x%mod;
n >>= 1;
}
return res;
}
signed main() {
ll n, m;
scanf("%lld %lld", &n, &m);
ll ans = min(n, m / 2), ama = m-ans*2;
if(ama > 0)
ans += ama / 4;
printf("%lld\n", ans);
return 0;
}
Submission Info
Submission Time
2017-02-18 21:06:29+0900
Task
C - Scc Puzzle
User
Gear
Language
C++14 (GCC 5.4.1)
Score
300
Code Size
1754 Byte
Status
AC
Exec Time
1 ms
Memory
256 KB
Compile Error
./Main.cpp: In function ‘int main()’:
./Main.cpp:64:28: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%lld %lld", &n, &m);
^
Judge Result
Set Name
Sample
All
Score / Max Score
0 / 0
300 / 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
AC
1 ms
256 KB
02.txt
AC
1 ms
256 KB
03.txt
AC
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