結果
| 問題 | No.22 括弧の対応 |
| コンテスト | |
| ユーザー |
testestest
|
| 提出日時 | 2015-08-05 02:54:30 |
| 言語 | C90(gcc12) (gcc 12.4.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 5,000 ms |
| コード長 | 182 bytes |
| 記録 | |
| コンパイル時間 | 130 ms |
| コンパイル使用メモリ | 29,508 KB |
| 最終ジャッジ日時 | 2026-02-23 18:56:47 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 19 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:5:1: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
5 | scanf("%d%d",&n,&n);i=n-1;
| ^~~~~~~~~~~~~~~~~~~
main.c:6:1: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
6 | scanf("%s",s);
| ^~~~~~~~~~~~~
ソースコード
#include <stdio.h>
int main(){
int n,i,t=0;
char s[10001];
scanf("%d%d",&n,&n);i=n-1;
scanf("%s",s);
n=s[n-1];while(t!=81-n*2)t+=s[n-40?--i:++i]*2-81;
printf("%d\n",i+1);
return 0;
}
testestest