Codeforces Round #279 (Div. 2) A. Team Olympiad 水题

#include<stdio.h>
#include<iostream>
#include<memory.h>
#include<math.h>
using namespace std;

int flag1[5000];
int flag2[5000];
int flag3[5000];
int main()
{
    memset(flag1,0,sizeof(flag1));
    memset(flag2,0,sizeof(flag2));
    memset(flag3,0,sizeof(flag3));
    int n;
    cin>>n;
    int kiss,kiss1=0,kiss2=0,kiss3=0;
    int minn=1000000;
    for(int i=0;i<n;i++)
    {
        cin>>kiss;
        if(kiss==1)
            flag1[++kiss1]=i;
        else if(kiss==2)
            flag2[++kiss2]=i;
        else
            flag3[++kiss3]=i;
    }
    minn=min(kiss1,min(kiss2,kiss3));
    cout<<minn<<endl;
    for(int i=0;i<minn;i++)
    {
        cout<<flag1[i+1]+1<<" "<<flag2[i+1]+1<<" "<<flag3[i+1]+1<<endl;
    }
    return 0;
}
时间: 2024-08-11 07:49:23

Codeforces Round #279 (Div. 2) A. Team Olympiad 水题的相关文章

Codeforces Round #113 (Div. 2)E---Tetrahedron(矩阵,水题)

You are given a tetrahedron. Let's mark its vertices with letters A, B, C and D correspondingly. An ant is standing in the vertex D of the tetrahedron. The ant is quite active and he wouldn't stay idle. At each moment of time he makes a step from one

Codeforces Round #279 (Div. 2) ABCD

Codeforces Round #279 (Div. 2) 做得我都变绿了! Problems # Name     A Team Olympiad standard input/output 1 s, 256 MB  x2377 B Queue standard input/output 2 s, 256 MB  x1250 C Hacking Cypher standard input/output 1 s, 256 MB  x740 D Chocolate standard input/

Codeforces Round #279 (Div. 2) b

/**  * @brief Codeforces Round #279 (Div. 2) b  * @file b.cpp  * @author mianma  * @created 2014/11/27 15:29  * @edited  2014/11/27 20:40  * @type   * @note  */ #include <cstdio> #include <stack> #include <cstring> #include <vector>

DFS Codeforces Round #306 (Div. 2) B. Preparing Olympiad

题目传送门 1 /* 2 DFS: 排序后一个一个出发往后找,找到>r为止,比赛写了return : 3 */ 4 #include <cstdio> 5 #include <iostream> 6 #include <cstring> 7 #include <cmath> 8 #include <algorithm> 9 #include <vector> 10 #include <map> 11 #include

Codeforces Round #279 (Div. 2) a

/**  * @brief Codeforces Round #279 (Div. 2) a  * @file a.cpp  * @author 面码  * @created 2014/11/26 17:05  * @edited  2014/11/26 17:05  * @type   *  */ #include <cstdio> #include <stack> #include <cstring> using namespace std; #define max

Codeforces Round #279 (Div. 2) d

/**  * @brief Codeforces Round #279 (Div. 2) d  * @file d.cpp  * @author 面码  * @created 2014/12/09 10:58  * @edited  2014/12/09 10:58  * @type math greedy  * @note 自己的AC不了,参考别人的,重点是2和3都是质数,所以可以使用贪心求解.  */ #include <fstream> #include <iostream>

Codeforces Round #279 (Div. 2) 题解集合

终于有场正常时间的比赛了...毛子换冬令时还正是好啊233 做了ABCD,E WA了3次最后没搞定,F不会= = 那就来说说做的题目吧= = A. Team Olympiad 水题嘛= = 就是个贪心什么的乱搞,貌似放A题难了 1 #include <cstdio> 2 #include <algorithm> 3 4 using namespace std; 5 const int N = 5005; 6 7 int cnt[5], first[5], next[N]; 8 9

Codeforces Round #279 (Div. 2)

A. Team Olympiad 水题英文还这么长... 1 #include<bits/stdc++.h> 2 #define eps 1e-9 3 #define FOR(i,j,k) for(int i=j;i<=k;i++) 4 using namespace std; 5 typedef long long LL; 6 int i,j,k,n,m,x,y,T,ans,big,cas; 7 bool flag; 8 vector <int> a[5]; 9 int n

Codeforces Round #259 (Div. 2) (简单模拟实现题)

题目链接:http://codeforces.com/problemset/problem/454/A A. Little Pony and Crystal Mine time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Twilight Sparkle once got a crystal from the Crystal Mine