結果
問題 | No.495 (^^*) Easy |
ユーザー |
|
提出日時 | 2025-01-30 15:55:19 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 275 bytes |
コンパイル時間 | 163 ms |
コンパイル使用メモリ | 27,008 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2025-01-30 15:55:21 |
合計ジャッジ時間 | 1,035 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 7 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:6:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 6 | scanf("%s", S); | ~~~~~^~~~~~~~~
ソースコード
#include <stdio.h>int main() {char S[1000000];int l = 0, r = 0, i = 0;scanf("%s", S);while(1) {if(S[i] == '(') {i ++;if(S[i] == '^') {l ++;}else {r ++;}}if(S[i] == '#') break;i ++;}printf("%d %d\n", l, r);return 0;}