結果
| 問題 |
No.495 (^^*) Easy
|
| コンテスト | |
| ユーザー |
0214sh7
|
| 提出日時 | 2017-03-24 23:06:18 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| コード長 | 272 bytes |
| コンパイル時間 | 145 ms |
| コンパイル使用メモリ | 22,912 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-05 23:17:28 |
| 合計ジャッジ時間 | 551 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 7 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:17:17: warning: format ‘%d’ expects a matching ‘int*’ argument [-Wformat=]
17 | scanf("%d");
| ~^
| |
| int*
main.cpp:5:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
5 | scanf("%s",S);
| ~~~~~^~~~~~~~
main.cpp:17:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
17 | scanf("%d");
| ~~~~~^~~~~~
ソースコード
#include <cstdio>
#define REP(i,n) for (int i=0;i<(n);i++)
int main(){
char S[114514];
scanf("%s",S);
int i=0;
int L=0,R=0;
while(S[i]!='#'){
if(S[i+1]=='^'){
L++;
}else if(S[i+1]=='*'){
R++;
}
i+=5;
}
printf("%d %d\n",L,R);
scanf("%d");
return 0;
}
0214sh7