結果
| 問題 |
No.35 タイパー高橋
|
| コンテスト | |
| ユーザー |
184
|
| 提出日時 | 2014-10-08 00:29:34 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 598 bytes |
| コンパイル時間 | 548 ms |
| コンパイル使用メモリ | 66,128 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-12-30 07:45:46 |
| 合計ジャッジ時間 | 1,043 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 4 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:24:27: warning: format ‘%s’ expects argument of type ‘char*’, but argument 3 has type ‘char (*)[100001]’ [-Wformat=]
24 | scanf("%d%s",&t,&s);
| ~^ ~~
| | |
| char* char (*)[100001]
main.cpp:19:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
19 | scanf("%d",&n);//%d%d%d%d%d%d%d%d%d",&n,&m,&a,&b,&c,&d,&e,&f,&x,&y);
| ~~~~~^~~~~~~~~
main.cpp:24:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
24 | scanf("%d%s",&t,&s);
| ~~~~~^~~~~~~~~~~~~~
ソースコード
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <iostream>
#include <map>
#include <vector>
#include <queue>
using namespace std;
/*
184 //名前が 184
no35
*/
int main(){
int n;//,m,a,b,c,d,e,f,x,y;
scanf("%d",&n);//%d%d%d%d%d%d%d%d%d",&n,&m,&a,&b,&c,&d,&e,&f,&x,&y);
char s[100001];
int t;
int ans=0,fans=0;
for(int i=0;i<n;i++){
scanf("%d%s",&t,&s);
double d=(double)t/1000*12;
//printf("%f\n",d);
if(d>=strlen(s))ans+=strlen(s);
else ans+=d,fans+=strlen(s)-(int)d;
}
printf("%d %d\n",ans,fans);
return 0;
}
184