結果
| 問題 |
No.35 タイパー高橋
|
| コンテスト | |
| ユーザー |
184
|
| 提出日時 | 2014-10-08 00:27:18 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 590 bytes |
| コンパイル時間 | 556 ms |
| コンパイル使用メモリ | 66,712 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-12-30 07:42:00 |
| 合計ジャッジ時間 | 1,063 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 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)-d;
}
printf("%d %d\n",ans,fans);
return 0;
}
184