結果

問題 No.35 タイパー高橋
ユーザー mono1977
提出日時 2016-12-01 12:40:23
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 1 ms / 5,000 ms
コード長 386 bytes
コンパイル時間 389 ms
コンパイル使用メモリ 30,976 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-27 15:33:52
合計ジャッジ時間 830 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 4
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:7:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    7 |         scanf("%d",&n);
      |         ~~~~~^~~~~~~~~
main.cpp:12:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   12 |                 scanf("%d %s",&t,s);
      |                 ~~~~~^~~~~~~~~~~~~~

ソースコード

diff #

#include<stdio.h>
#include<math.h>
#include<string.h>

int main(){
	int n;
	scanf("%d",&n);
	int correct=0,incorrect=0;
	int i,t;
	char s[101];
	for(i=0;i<n;i++){
		scanf("%d %s",&t,s);
		if(floor(12*t/1000)>=strlen(s)){
			correct+=strlen(s);
		}else{
			correct+=floor(12*t/1000);
			incorrect+=strlen(s)-floor(12*t/1000);
		}
	}
	
	printf("%d %d\n",correct,incorrect);
	
	return 0;
}
0