群赛11.10 A Very Easy Triangle Counting Game

Problem G: A Very Easy Triangle Counting Game

Time Limit: 1 Sec   Memory Limit: 128 MB
Submit: 80   Solved: 31
[ Submit][ Status][ Web Board]

Description

群赛11.10 A Very Easy Triangle Counting Game_第1张图片

群赛11.10 A Very Easy Triangle Counting Game_第2张图片

群赛11.10 A Very Easy Triangle Counting Game_第3张图片

Input

 

Output

 

Sample Input

3
1
4
6

Sample Output

Case #1: 0
Case #2: 8
Case #3: 32

HINT

#include <cstdio>
#include <cstring>
#include <queue>
#include <stack>
#include <algorithm>
#include <iostream>
using namespace std;
int solve(int n)
{
    if(n<3) return 0;
    if(n==3) return 1;
    if(n==4) return 8;
    if(n==5) return 35;
    if(n==6) return 32;
    int ans=0;
    ans = 5*n;
    return ans%20121111;
}
int main()
{
    freopen("in.txt","r",stdin);
    int cas,T=1;
    scanf("%d",&cas);
    while(cas--)
    {
        int n;
        scanf("%d",&n);
        printf("Case #%d: %d\n",T++,solve(n));
    }
    return 0;
}



你可能感兴趣的:(群赛)