Submission #1114688
Source Code Expand
#include <bits/stdc++.h> using namespace std; //debug #ifdef grief #define debug(...) do{\ fprintf(stderr , "%s - %d : (%s) = " , __PRETTY_FUNCTION__ , __LINE__ , #__VA_ARGS__ );\ _DO(__VA_ARGS__);\ }while(0) template<typename I> void _DO(I&&x){ cerr<<x<<endl; } template<typename I,typename...T> void _DO(I&&x,T&&...tail){ cerr<<x<<" , "; _DO(tail...); } #else #define debug(...) #endif //type typedef long long ll; typedef pair<int,int> pii; typedef long long ll; typedef pair<ll,ll> pll; typedef priority_queue<pll,vector<pll>,greater<pll> > heap; //macro #define SZ(x) ((ll)(x).size()) #define ALL(x) (x).begin(),(x).end() #define F first #define S second #define REP(i,n) for(ll i=0;i<(n);i++) #define REP1(i,a,b) for(ll i=(a);i<=(b);i++) #define mkp make_pair #define pb push_back const ll INF=1e18; const ll MA=1e6+5; const ll MOD=1e9+7; //}}} ll n,m; ll ans; int main(){ cin>>n>>m; ans=min(n,m/2); n-=ans; m-=ans*2; ans+=m/4; cout<<ans<< '\n'; return 0; }
Submission Info
Submission Time | |
---|---|
Task | C - Scc Puzzle |
User | lawfung |
Language | C++14 (GCC 5.4.1) |
Score | 300 |
Code Size | 1023 Byte |
Status | AC |
Exec Time | 1 ms |
Memory | 256 KB |
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 |