提出 #577602


ソースコード 拡げる

#include <bits/stdc++.h>
#define openfile(s) freopen(s".in","r",stdin);freopen(s".out","w",stdout)
#define mpr std::make_pair
#define lg(x) (31-__builtin_clz(x))
#define lgll(x) (63-__builtin_clzll(x))
#define __count __builtin_popcount
#define __countll __builtin_popcountll
#define X first
#define Y second
#define mst(x) memset(x,0,sizeof(x))
#define mst1(x) memset(x,-1,sizeof(x))
#define ALL(c) (c).begin(),(c).end()
#define FOR(i,n) for(int i=0;i<n;i++)
#define FOR1(i,n) for(int i=1;i<=n;i++)
#define FORit(it,c) for(__typeof(c.begin()) it=c.begin();it!=c.end();++it)
#define pb push_back
#define RI(x) scanf("%d",&x)
#define RID(x) int x;RI(x)
using namespace std;
typedef long long LL;
typedef double LD;
typedef vector<int> VI;
typedef std::pair<int,int> PII;
template<class T>inline void maz(T &a,T b){if(a<b)a=b;}
template<class T>inline void miz(T &a,T b){if(a>b)a=b;}
template<class T>inline T abs(T a){return a>0?a:-a;}
const int N=1000100, INF=1e9;
const LD EPS=1e-7;
char S[N];
int main(){
	//openfile("");
	RID(n);
	scanf("%s",S);
	int ans = 0;
	int len = strlen(S);
	int now = -1;
	for(int i=0;S[i];i++){
		if(S[i] == '>') {now = strlen(S)-i;break;}
	}
	if(now != -1) ans = now;
	now = -1;
	for(int i=len-1;i>=0;i--){
		if(S[i] == '<') {now = i+1;break;}
	}
	if(now != -1) ans = max(now,ans);
	printf("%d\n",ans);

	return 0;
}

提出情報

提出日時
問題 D - Line Gimmick
ユーザ TaipeiMeow
言語 C++11 (GCC 4.8.1)
得点 100
コード長 1396 Byte
結果 AC
実行時間 28 ms
メモリ 1052 KiB

コンパイルエラー

./Main.cpp: In function ‘int main()’:
./Main.cpp:32:8: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
  RID(n);
        ^
./Main.cpp:33:15: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
  scanf("%s",S);
               ^

ジャッジ結果

セット名 All
得点 / 配点 100 / 100
結果
AC × 29
セット名 テストケース
All 00_sample_00, 00_sample_01, 00_sample_02, 00_sample_03, 10_simple_small_000, 10_simple_small_001, 10_simple_small_002, 10_simple_small_003, 10_simple_small_004, 11_simple_med_000, 11_simple_med_001, 11_simple_med_002, 11_simple_med_003, 11_simple_med_004, 12_simple_large_000, 12_simple_large_001, 12_simple_large_002, 12_simple_large_003, 12_simple_large_004, 21_answer_med_000, 21_answer_med_001, 21_answer_med_002, 21_answer_med_003, 21_answer_med_004, 22_answer_large_000, 22_answer_large_001, 22_answer_large_002, 22_answer_large_003, 22_answer_large_004
ケース名 結果 実行時間 メモリ
00_sample_00 AC 26 ms 916 KiB
00_sample_01 AC 26 ms 916 KiB
00_sample_02 AC 25 ms 924 KiB
00_sample_03 AC 25 ms 924 KiB
10_simple_small_000 AC 26 ms 920 KiB
10_simple_small_001 AC 27 ms 912 KiB
10_simple_small_002 AC 26 ms 916 KiB
10_simple_small_003 AC 26 ms 916 KiB
10_simple_small_004 AC 26 ms 924 KiB
11_simple_med_000 AC 25 ms 920 KiB
11_simple_med_001 AC 25 ms 1040 KiB
11_simple_med_002 AC 25 ms 924 KiB
11_simple_med_003 AC 25 ms 920 KiB
11_simple_med_004 AC 25 ms 920 KiB
12_simple_large_000 AC 26 ms 1048 KiB
12_simple_large_001 AC 26 ms 1052 KiB
12_simple_large_002 AC 26 ms 1040 KiB
12_simple_large_003 AC 26 ms 1048 KiB
12_simple_large_004 AC 26 ms 1048 KiB
21_answer_med_000 AC 26 ms 1040 KiB
21_answer_med_001 AC 26 ms 1028 KiB
21_answer_med_002 AC 26 ms 1048 KiB
21_answer_med_003 AC 27 ms 940 KiB
21_answer_med_004 AC 27 ms 940 KiB
22_answer_large_000 AC 26 ms 1044 KiB
22_answer_large_001 AC 28 ms 1044 KiB
22_answer_large_002 AC 26 ms 1044 KiB
22_answer_large_003 AC 26 ms 1044 KiB
22_answer_large_004 AC 26 ms 1048 KiB