結果
問題 | No.35 タイパー高橋 |
ユーザー |
![]() |
提出日時 | 2017-05-04 17:18:17 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 5,000 ms |
コード長 | 374 bytes |
コンパイル時間 | 243 ms |
コンパイル使用メモリ | 23,552 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-14 07:10:01 |
合計ジャッジ時間 | 695 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 4 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:22:30: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 22 | scanf("%d%s", &t, s); | ~~~~~^~~~~~~~~~~~~~~
ソースコード
#include<cstdio> #include<cstring> int min(int a, int b) { if(a<b) return a; return b; } int main(void) { int n, t, i, c, s_len, ok, ng; char s[100+2]; while(scanf("%d", &n)==1) { ok=ng=0; for(i=0;i<n;i++) { scanf("%d%s", &t, s); s_len=strlen(s); c=min(s_len, t*12/1000); ok+=c; ng+=s_len-c; } printf("%d %d\n", ok, ng); } return 0; }