結果

問題 No.35 タイパー高橋
ユーザー piyoko_212piyoko_212
提出日時 2015-12-28 23:51:32
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 1 ms / 5,000 ms
コード長 310 bytes
コンパイル時間 312 ms
コンパイル使用メモリ 34,148 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-19 12:10:16
合計ジャッジ時間 839 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,348 KB
testcase_01 AC 1 ms
4,348 KB
testcase_02 AC 1 ms
4,348 KB
testcase_03 AC 1 ms
4,348 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:7:20: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    7 |         int a;scanf("%d",&a);
      |               ~~~~~^~~~~~~~~
main.cpp:11:28: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   11 |                 int t;scanf("%d%s",&t,in);
      |                       ~~~~~^~~~~~~~~~~~~~

ソースコード

diff #

#include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;
char in[2100];
int main(){
	int a;scanf("%d",&a);
	int A=0;
	int B=0;
	while(a--){
		int t;scanf("%d%s",&t,in);
		int s=strlen(in);
		int can=t*12/1000;
		if(s>can){
			B+=s-can;
			A+=can;
		}else A+=s;
	}
	printf("%d %d\n",A,B);
}
0