結果
問題 |
No.35 タイパー高橋
|
ユーザー |
![]() |
提出日時 | 2018-06-21 15:45:54 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 5,000 ms |
コード長 | 391 bytes |
コンパイル時間 | 106 ms |
コンパイル使用メモリ | 22,400 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-30 17:36:10 |
合計ジャッジ時間 | 492 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 4 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:9:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 9 | scanf("%d", &N); | ~~~~~^~~~~~~~~~ main.cpp:11:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 11 | scanf("%d %s", &T, S); | ~~~~~^~~~~~~~~~~~~~~~
ソースコード
#include<stdio.h> int main(void){ int i, j; int N, T; char S[100]; int wright = 0, miss = 0; scanf("%d", &N); for(i = 0; i < N; i++){ scanf("%d %s", &T, S); j = 0; while(S[j] != '\0') j++; if((T * 12 / 1000) >= j) wright += j; else{ wright += T * 12 / 1000; miss += j - T * 12 / 1000;; } } printf("%d %d\n", wright, miss); return 0; }