Submission #1966199


Source Code Expand

using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Linq.Expressions;
using System.Runtime.InteropServices;
using System.Runtime.Remoting.Messaging;
using System.Security.Principal;
using System.Text;
class Simple
{
    long N, M;
    void Solve() {
        //input
        N = io.Long;
        M = io.Long;
        //cal
        var create = Math.Min(N, M / 2);        
        var leftC = M - 2 * create;
        var add = leftC / 4;//S=c*2,c,c
        var ans = create + add;
        //ret
        Console.WriteLine(ans);
    }
    SimpleIO io = new SimpleIO();
    public static void Main(string[] args) => new Simple().Stream();
    void Stream() {
        //var exStdIn = new System.IO.StreamReader("stdin.txt");
        //System.Console.SetIn(exStdIn);
        Solve();
        io.writeFlush();
    }
}
class SimpleIO
{
    string[] nextBuffer;
    int BufferCnt;
    char[] cs = new char[] { ' ' };
    StreamWriter sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
    public SimpleIO() {
        nextBuffer = new string[0];
        BufferCnt = 0;
        Console.SetOut(sw);
    }
    public string Next() {
        if (BufferCnt < nextBuffer.Length) return nextBuffer[BufferCnt++];
        string st = Console.ReadLine();
        while (st == "") st = Console.ReadLine();
        nextBuffer = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
        BufferCnt = 0;
        return nextBuffer[BufferCnt++];
    }
    public string String => Next();
    public char Char => char.Parse(String);
    public int Int => int.Parse(String);
    public long Long => long.Parse(String);
    public double Double => double.Parse(String);
    public void writeFlush() { Console.Out.Flush(); }
}

Submission Info

Submission Time
Task C - Scc Puzzle
User rui0422
Language C# (Mono 4.6.2.0)
Score 300
Code Size 1880 Byte
Status AC
Exec Time 21 ms
Memory 11092 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 2
AC × 9
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 20 ms 11092 KB
00_example_02.txt AC 21 ms 11092 KB
01.txt AC 20 ms 9044 KB
02.txt AC 20 ms 9044 KB
03.txt AC 21 ms 9044 KB
04.txt AC 20 ms 9044 KB
05.txt AC 21 ms 9044 KB
06.txt AC 21 ms 11092 KB
07.txt AC 20 ms 9044 KB