Submission #35095730


Source Code Expand

///Never gonna give you up.
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
typedef long long ll;
typedef long long int lli;
typedef unsigned long long ull;
using namespace std;
using namespace __gnu_pbds;
template<class x>
using ordered_set = tree<x, null_type,less<x>, rb_tree_tag,tree_order_statistics_node_update>;
const ll mod=(ll)1e9+7;
const ll mod1=998244353;
///the defines :)
#define endl '\n'
#define vi vector<int>
#define vll vector<ll>
#define ent(arr) for(int i=0;i<arr.size();i++)cin>>arr[i];
#define all(arr) arr.begin(),arr.end()
#define allr(arr) arr.rbegin(),arr.rend()
#define sz size()
#define int long long
///the end of the defines ;)
void bla()
{
  
#ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("notsus.txt","w",stdout);
#endif
}
void preprocess(){}
void solve()
{
  int x=0,y=0,z=0;
  int a,b;
  cin>>a>>b;
  if(a%2)x=1,a--;
  if(b%2)x=1,b--;
  if(a%2==0&&a>=4)y=4,a-=4;
  if(b%2==0&&b>=4)y=4,b=-4;
  if(b==2)z=2;
  if(a==2)z=2;
  cout<<z+y+x<<endl; 
}
int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    preprocess();
    bla();
    int t=1;
    //cin>>t;
    while(t--)
        solve();
}

Submission Info

Submission Time
Task A - 1-2-4 Test
User phares
Language C++ (GCC 9.2.1)
Score 100
Code Size 1296 Byte
Status AC
Exec Time 7 ms
Memory 3564 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 100 / 100
Status
AC × 3
AC × 10
Set Name Test Cases
Sample example_00.txt, example_01.txt, example_02.txt
All example_00.txt, example_01.txt, example_02.txt, hand_00.txt, hand_01.txt, hand_02.txt, hand_03.txt, hand_04.txt, hand_05.txt, hand_06.txt
Case Name Status Exec Time Memory
example_00.txt AC 7 ms 3488 KiB
example_01.txt AC 3 ms 3536 KiB
example_02.txt AC 2 ms 3540 KiB
hand_00.txt AC 2 ms 3484 KiB
hand_01.txt AC 2 ms 3540 KiB
hand_02.txt AC 3 ms 3540 KiB
hand_03.txt AC 2 ms 3528 KiB
hand_04.txt AC 2 ms 3540 KiB
hand_05.txt AC 2 ms 3480 KiB
hand_06.txt AC 1 ms 3564 KiB