DigitalArts プログラミングコンテスト2012

Submission #53742

Source codeソースコード

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main()
{
	int N,M,K;
	cin>>N>>M>>K;
	vector<char> t(M);
	vector<int> j(M);
	vector<int> k(M);
	for ( int i=0; i<M; i++ )
	{
		cin>>t[i];
		if ( t[i]=='t' )  cin>>j[i], j[i]--;
		if ( t[i]=='f' )  cin>>j[i]>>k[i], j[i]--, k[i]--;
		if ( t[i]=='u' )  cin>>j[i]>>k[i], j[i]--, k[i]--;
	}

	vector<int> T(N);	//	TLの発言数
	vector<int> C(N);	//	自分の発言数
	for ( int i=M-1; i>=0; i-- )
	{
		if ( t[i]=='t' )  C[j[i]]++;
		if ( t[i]=='f' )  T[j[i]]+=C[k[i]], T[k[i]]+=C[j[i]];
		if ( t[i]=='u' )  T[j[i]]-=C[k[i]], T[k[i]]-=C[j[i]];
	}
	for ( int i=0; i<N; i++ )
		T[i] += C[i];

	sort(T.begin(),T.end(),greater<int>());
	cout << T[K-1] << endl;

	return 0;
}

Submission

Task問題 C - Chokutter
User nameユーザ名 kusano
Created time投稿日時
Language言語 C++ (G++ 4.6.4)
Status状態 AC
Score得点 100
Source lengthソースコード長 788 Byte
File nameファイル名
Exec time実行時間 114 ms
Memory usageメモリ使用量 2436 KB

Test case

Set

Set name Score得点 / Max score Cases
All 100 / 100 00_min.txt,00_sample_01.txt,00_sample_02.txt,00_sample_03.txt,00_sample_04.txt,00_sample_05.txt,00_sample_06.txt,01_rand_00.txt,01_rand_01.txt,01_rand_02.txt,01_rand_03.txt,01_rand_04.txt,01_rand_05.txt,01_rand_06.txt,01_rand_07.txt,01_rand_08.txt,01_rand_09.txt,01_rand_10.txt,01_rand_11.txt,01_rand_12.txt,01_rand_13.txt,01_rand_14.txt,01_rand_15.txt,01_rand_16.txt,01_rand_17.txt,01_rand_18.txt,01_rand_19.txt,01_rand_20.txt,01_rand_21.txt,01_rand_22.txt,01_rand_23.txt,01_rand_24.txt,01_rand_25.txt,01_rand_26.txt,01_rand_27.txt,01_rand_28.txt,01_rand_29.txt,02_1p_00.txt,02_1p_01.txt,02_1p_02.txt,02_1p_03.txt,02_1p_04.txt,02_1p_05.txt,02_1p_06.txt,02_1p_07.txt,02_1p_08.txt,02_1p_09.txt,03_2p_00.txt,03_2p_01.txt,03_2p_02.txt,03_2p_03.txt,03_2p_04.txt,03_2p_05.txt,03_2p_06.txt,03_2p_07.txt,03_2p_08.txt,03_2p_09.txt,04_3p_00.txt,04_3p_01.txt,04_3p_02.txt,04_3p_03.txt,04_3p_04.txt,04_3p_05.txt,04_3p_06.txt,04_3p_07.txt,04_3p_08.txt,04_3p_09.txt,05_np_00.txt,05_np_01.txt,05_np_02.txt,05_np_03.txt,05_np_04.txt,05_np_05.txt,05_np_06.txt,05_np_07.txt,05_np_08.txt,05_np_09.txt,05_np_10.txt,05_np_11.txt,05_np_12.txt,05_np_13.txt,05_np_14.txt,05_np_15.txt,05_np_16.txt,05_np_17.txt,05_np_18.txt,05_np_19.txt

Test case

Case name Status状態 Exec time実行時間 Memory usageメモリ使用量
00_min.txt AC 21 ms 784 KB
00_sample_01.txt AC 22 ms 808 KB
00_sample_02.txt AC 21 ms 792 KB
00_sample_03.txt AC 21 ms 792 KB
00_sample_04.txt AC 21 ms 776 KB
00_sample_05.txt AC 20 ms 808 KB
00_sample_06.txt AC 21 ms 780 KB
01_rand_00.txt AC 23 ms 1296 KB
01_rand_01.txt AC 111 ms 2424 KB
01_rand_02.txt AC 78 ms 1680 KB
01_rand_03.txt AC 109 ms 2432 KB
01_rand_04.txt AC 26 ms 1528 KB
01_rand_05.txt AC 83 ms 1656 KB
01_rand_06.txt AC 21 ms 760 KB
01_rand_07.txt AC 23 ms 1144 KB
01_rand_08.txt AC 110 ms 2424 KB
01_rand_09.txt AC 73 ms 1676 KB
01_rand_10.txt AC 90 ms 1660 KB
01_rand_11.txt AC 21 ms 788 KB
01_rand_12.txt AC 24 ms 1528 KB
01_rand_13.txt AC 109 ms 2424 KB
01_rand_14.txt AC 21 ms 788 KB
01_rand_15.txt AC 108 ms 2436 KB
01_rand_16.txt AC 25 ms 1524 KB
01_rand_17.txt AC 106 ms 2428 KB
01_rand_18.txt AC 73 ms 1656 KB
01_rand_19.txt AC 102 ms 1796 KB
01_rand_20.txt AC 91 ms 1676 KB
01_rand_21.txt AC 30 ms 880 KB
01_rand_22.txt AC 98 ms 1680 KB
01_rand_23.txt AC 61 ms 1272 KB
01_rand_24.txt AC 81 ms 1684 KB
01_rand_25.txt AC 88 ms 1660 KB
01_rand_26.txt AC 20 ms 780 KB
01_rand_27.txt AC 25 ms 1556 KB
01_rand_28.txt AC 109 ms 2432 KB
01_rand_29.txt AC 110 ms 2428 KB
02_1p_00.txt AC 23 ms 1288 KB
02_1p_01.txt AC 113 ms 2416 KB
02_1p_02.txt AC 112 ms 2404 KB
02_1p_03.txt AC 28 ms 1528 KB
02_1p_04.txt AC 114 ms 2416 KB
02_1p_05.txt AC 88 ms 1668 KB
02_1p_06.txt AC 114 ms 2428 KB
02_1p_07.txt AC 56 ms 1880 KB
02_1p_08.txt AC 21 ms 784 KB
02_1p_09.txt AC 53 ms 1392 KB
03_2p_00.txt AC 23 ms 1276 KB
03_2p_01.txt AC 113 ms 2424 KB
03_2p_02.txt AC 112 ms 2420 KB
03_2p_03.txt AC 98 ms 1652 KB
03_2p_04.txt AC 82 ms 1648 KB
03_2p_05.txt AC 24 ms 1524 KB
03_2p_06.txt AC 25 ms 1540 KB
03_2p_07.txt AC 110 ms 2420 KB
03_2p_08.txt AC 112 ms 2424 KB
03_2p_09.txt AC 81 ms 1672 KB
04_3p_00.txt AC 23 ms 1304 KB
04_3p_01.txt AC 24 ms 1536 KB
04_3p_02.txt AC 24 ms 1536 KB
04_3p_03.txt AC 111 ms 2396 KB
04_3p_04.txt AC 22 ms 784 KB
04_3p_05.txt AC 111 ms 2428 KB
04_3p_06.txt AC 24 ms 1536 KB
04_3p_07.txt AC 25 ms 1528 KB
04_3p_08.txt AC 111 ms 2416 KB
04_3p_09.txt AC 25 ms 1532 KB
05_np_00.txt AC 24 ms 1272 KB
05_np_01.txt AC 78 ms 1684 KB
05_np_02.txt AC 23 ms 1172 KB
05_np_03.txt AC 21 ms 780 KB
05_np_04.txt AC 111 ms 2424 KB
05_np_05.txt AC 109 ms 2428 KB
05_np_06.txt AC 25 ms 1552 KB
05_np_07.txt AC 52 ms 1660 KB
05_np_08.txt AC 109 ms 2432 KB
05_np_09.txt AC 111 ms 2400 KB
05_np_10.txt AC 88 ms 1632 KB
05_np_11.txt AC 22 ms 780 KB
05_np_12.txt AC 85 ms 1680 KB
05_np_13.txt AC 111 ms 2360 KB
05_np_14.txt AC 25 ms 1540 KB
05_np_15.txt AC 49 ms 1788 KB
05_np_16.txt AC 111 ms 2428 KB
05_np_17.txt AC 74 ms 1684 KB
05_np_18.txt AC 21 ms 784 KB
05_np_19.txt AC 23 ms 784 KB